Anthony J. Martinez

Fun with Emacs

Somewhere around a year ago I bailed on vi(m) as my primary editor. I did this after two decades of faithfully carrying the vi(m) torch in the holy flame wars of "no myyyy editor is better." For the first few weeks of GNU/Emacs use, I tried to use Emacs natively with its own keybindings. This was, to an old vi(m) user, maddening. I quickly found myself using EVIL mode, and proclaiming that Emacs is actually the best version of vi(m) in existence (and yes, I tried NeoVim and all the rest).

In a given week, I frequently find myself connected to remote hosts on which Emacs is not installed and this has left me with plenty of time to use my old friends from the vi family. With some twenty years of familiarity it is not like any of the keybindings or wizard-like motions have fled my mind. At some point, quite probably because it is often difficult to reason about which mode one might be in when accessing a system over a remote link best described as "glacial", I started to get pretty tired of smacking Esc all the time. I confess to frequently abusing sed -i when I know exactly what I want to change and where.

There is an easier way that I keep forgetting even exists: TRAMP.

This very post was written using TRAMP to:

  1. Connect to my server as my normal user
  2. Change to the user under which my site's process runs
  3. Create and edit the markdown from which the post is rendered

Some of the more advanced extensions I run in Emacs for use as a rather powerful Python and Rust IDE appear to conflict with TRAMP, but running in a minimal config is trivial and functional so I may not even mess with figuring out exactly where the failure is induced. Over the next few weeks I may mess with seeing how this works in my day to day job where I must frequently access remote hosts just to edit a text file or two. Doing it all from Emacs has some appeal.

Even with TRAMP, I still find myself annoyed with changing modes to do a number of things. EVIL was removed from my init.el and several modes are now less hampered by binding conflicts. While it's only been a day, I am enjoying it rather a lot. Adding a little enjoyment back to computing is worth it.