Back to Small Clever Rooms

RSS Feed

A Vimmer’s Emacs Prerequisites

In a previous post I explained why Vim and Sublime Text ultimately disappointed me; in this one, I’m going to describe how I finally found at least temporary respite in Emacs and what it took to get me there.

I had a rocky start with Emacs. Actually I had about four of them. There was never any question that I was going to use Evil-mode, Emacs’s vi emulation layer. I understand that it arose from the ashes of several previous such efforts to become one of the most complete vi emulations available for any text editor besides ones that derive from vi itself.

Coming from Sublime Text’s deeply inadequate or flawed vi emulation packages, Evil was a revelation. With very few exceptions, it really is just like using Vim. It’s all that other crap that Emacs does that I had to make sense of somehow and that tripped me up the first several times I made a serious attempt at learning it.

One of the popular jokes about Emacs is that it stands for “Escape Meta Alt Control Shift”, a jab at the countless arcane key chords that you’re expected to use to invoke its mind-boggling array of features. Almost immediately, I decided that finding a way to avoid those chords in favor of using Vim-style key sequences mostly without modifiers would be a prerequisite for my using Emacs full time.

To make this distinction a bit clearer: The key command to quit Emacs is C-x C-c , which means “control-x followed by control-c”. Take a look at this table of Emacs commands and you’ll get an idea why there’s a whole flavor of RSI named for Emacs and why I wanted to just swap those key bindings out from the get go. What I really wanted was to bulk-convert all of Emacs’s RSI-inducing chords to key sequences like ones using Vim’s leader keys: for example, the aforementioned C-x C-c might become \xc or something.

My first pass at this had me using god-mode to take a bunch of the modifiers out of Emacs commands. But I had some trouble getting god-mode to play nice with Evil, even when I used the charmingly titled evil-god-state to tie the two together. I suspect that this was actually a perfectly viable way to achieve what I wanted and some misunderstanding on my part prevented me from getting it working; I was too new to Emacs and tried to deviate from its norms too much too fast. If you use evil-mode and god-mode together I’d be interested to hear how it works for you.

By this point I’d dipped my toes into Emacs enough to have a handle on Emacs Lisp, the (far superior to Vimscript) language used to do all of Emacs’s extensive customization. I’d tried the “build up an Emacs config from scratch” thing a couple times and ended up frustrated with it due to its being a total crap shoot whether any given plugin would play nice with evil-mode. So when I came across a starter kit whose tagline is “The best editor is neither Emacs nor Vim, it’s Emacs and Vim!”, and which purports to be “first intended to be used by Vim users who want to go to the next level by using Emacs”, I was 100% ready to jump feet-first into an unabashedly Evil-centric starter kit.