Review of evil-mode for emacs

Andrew Hyatt
3 min readJan 5, 2015

--

Evil-mode, the extensible vi layer for Emacs, (https://gitorious.org/evil/pages/Home) is one of the hottest emacs extensions around. By providing a very thorough vi compatibility, much better than the older vi-mode, it enables both new vi users to come into emacs and existing users to experiment with vi’s editing style. Suddenly, the emacs versus vi war may be obsolete, or at least mutated from a war about executables into a war about editing styles.

But, is it worth checking out for those already using emacs?

I’m a long-time emacs user. My fingers are already trained in emacs keybindings, however I’ve never trained myself in the art of moving or selecting paragraphs or sentences. My emacs movements are, frankly, inelegant. I’ve seen other people use emacs. No offense to emacs users, but our editing lacks the beauty and precision of vi.

Vi sports a language that is very logical and concise, and due to the use of modes, less awkward hand movements are required. vip will select a paragraph, vis will select a sentence, gqap will format a paragraph, gqas, will format a sentence, etc. I really liked doing operations like “replace everything within parens” (“ci)”), and deleting everything until a semicolon (“dt;”). In some respects, this really did bring a new efficiency to my editing.

On the other hand, vi emulation seemed suboptimal at times. When you search for something, you have to type a slash, then your search string. And when you find it, you have to type return, otherwise you wind up back where you started at next keypress. Plus the matching terms are highlighted forever. How do you get it to stop? “:noh”. That seems needlessly obtuse for something that I want to happen all the time. And there might be a way to easily transpose letters or words as easily as emacs lets you do, but I haven’t found it.

Some things just didn’t work with evil-mode. Notably, the great multiple-cursors package is not compatible. It’s hard to go back from using that package to the much more difficult-to-use vim equivalents. Evil-mode, though, helpfully makes vim a little better by highlighting when you type substitution commands such as “:%s/foo/bar”. Nice, but not nearly as nice as multiple-cursors mode.

Other more core incompatibilities pop up annoyingly from time to time. Want to evaluate the lisp expression you are on? Well, what you can’t do is go to the end of the s-expression and evaluate it as you are used to, since at the end of the s-expression your cursor is on the last paren, not beyond it, so you can only evaluate the last expression in the s-expression, not the whole s-expression. To evaluate the whole s-expression, you can go to the very beginning of the next line. These kind of annoyances pop up from time to time.

Plus, no matter how good Evil is, or how well integrated it is into all sorts of things (and it can work well for many modes, including org-mode), there will always be modes in which you just have to use plain old emacs navigation. In Gnus, for example. Or scrolling through results in ido-mode. Evil, as awesome as it is, can’t really hide the essential emacs editing paradigm completely, only mask it.

Similarly, hitting the Escape key to switch modes is actually problematic in emacs, since it also is a prefix key for lots of emacs commands, whether you are in evil-mode or not. I think even hardcore vi users will run into problems, notably on slower terminal connections.

If you are interested in trying it out, I highly recommend spacemacs, which is a whole componentized startup kit that is specially made for the Evil user. It takes Evil mode as far as it can go, and it’s pretty well thought out.

Will I keep using it? Maybe. I’ll give it a while longer. But, in the long run, probably not. It’s a really solid package, but I probably would have a more coherent emacs experience using normal emacs editing. I just have to get better at it.

--

--

Andrew Hyatt

From St. Louis, lived in Urbana, IL, Silicon Valley, now NYC