🏠 Go home.

Evil and Emacs: An Uholy Matrimony

Published on

People are finally starting to learn the lessons of Vim. For years I've advocated for learning Vim as more than a tool but as a language in and of itself. Its ability to compose adverbs, verbs and nouns together to elegantly manipulate text has been lost on, well, basically every editor since then. Not even to get in to the modality argument that makes much of Vim's power easier to grasp and use.

This made it all the more difficult when I switched to Emacs a few months back. Org-mode has made my life an order of magnitude better, just from the standpoint of not losing tasks, not forgetting events, not forgetting things I've read and said, or when I was working on a given project. It's a fantastic piece of kit, but to really get the full effect you have to opt in to the entire Emacs lifestyle. I moved my mail over to Gnus, I moved my code projects over to Emacs, and I did the unthinkable:

alias vim='emacsclient -t'

The effect has been interesting; for a while I used the built-in Emacs vi-emulation layer, Viper. I struggled with it a lot before falling back to the older mode, evil, which provides more vim features. It was a god-send and what caused me to set up that alias to begin with. I could actually be productive editing code and prose in Emacs. I could compose, and didn't feel as though I was lacking features - I had visual selection modes and motherfucking text objects.

People poo poo Emacs because of a few reasons, and most of them are valid to some extent. Vim is available to some extent on every UNIX computer, Emacs is a super heavy package, and Emacs's chorded commands leave users far more prone to fun things like RSI. I posit that minimal Evil configuration can solve all of this, and leave you with an environment that is similar enough to an OOTB vim that you can still SSH in to remote servers and work on them as necessary without losing your abilities to do that productively. I added a few things to my readme.org and had it working:


            (global-evil-surround-mode 1)
            (global-evil-matchit-mode 1)

Of course, I had a few evil plugins installed, can't live without surround and matchit, and well evil has ports of them, as well as a leader implementation that I'm going to pull in.

I will admit that it's much more cumbersome to set up remap'd keys in Emacs/Evil than it is to do so in Vim but the overall experience gives me the best of both worlds, and I don't see myself switching any time soon, unless NeoVim gets an org-mode port, and maybe not even then. Emacs's extensibility has let it gain the composability of Vim, and that is one of the most exciting parts of it. Everyone has forgotten about Vim's lessons in favor of Emacs's except, of course, Emacs itself.

Respond to this note:

Ryan Rix is a privacy rights advocate and net-art wannabe. Reach them on the Fediverse as @rrix@cybre.space, twitter as @rrrrrrrix, via email to ryan@whatthefuck.computer or on Facebook or on Matrix as @rrix:whatthefuck.computer.