Ditching Evil Mode in Emacs
Several weeks ago after a bit of unnecessary tinkering (as we are wont to do) I realized that my emacs config, whilst fine and functional, only worked with evil-mode, evil-collection, and general.el. If any one of those packages didn’t load, or if I wanted to move away from them for whatever reason, I would be looking at a substantial rewrite. So I decided I would embrace a bit of conventional wisdom and go down the path of using default navigation keybindings to the greatest extent possible, and create new custom keybindings for features I frequently use without default bindings. Here I’m talking about just navigation things - moving between buffers, windows, tabs, etc. (At the time) I was not talking about editing modes - I was still 100% committed to vim/evil.
Nevertheless I wanted my custom bindings to be “mode” agnostic, so that ruled out using general.el and also using SPC as a leader key (since the non-modal default bindings need to insert a space with SPC). I tried Alt-SPC for a while instead, but that was surprisingly awkward even though it can be done with either hand, one hand, or even just the thumb if angled correctly. I decided to just embrace conventional emacs wisdom and rewrite my custom keybindings with C-c.
On my first read-through of Mastering Emacs, I thought some of the emacs navigation bindings were just ridiculous; the shear volume of bindings with no seeming rhyme or reason seemed absurd. After forcing myself to learn them, I realize the navigation bindings are actually surprisingly consistent - it’s the same pattern across windows, frames, and tabs. And C-c for custom bindings has been just fine. It was with this in mind that I thought: maybe I’m just misunderstanding the emacs editor keybindings as well?
My first step was to create my emacs keybindings that I could access in insert-mode (called insert state in evil). Not really necessary as you can locally toggle evil-mode with C-z, but this at least got me to start using things like M-d or C-k when I was too lazy to hit the ESC key to get back into normal mode. This was fine, but it wasn’t enough to seriously learn and use them.
So after a couple minutes of consideration and somewhat on a whim, I decided to rip off the bandaid and switch away from using evil-mode in gnu emacs. Here are some of my reasons for doing so:
Abbreviated and impromptu list of reasons to not use evil mode:
- Curiosity.
- Improve my bash default keybinding proficiency.
- Not be completely retarded when my init.el fails to fully load or cannot load at all.
- Cut down on emacs packages and abstractions.
- Most importantly: experience emacs packages as the developers intended.
I really want to focus mostly on the last one because that is my primary motivation. It was during my research of elfeed that I realized evil-mode and specifically evil-collection do quite a bit of violence to the original keybindings from the author. By now I knew that evil-collection made changes on most packages - e.g. dired - but for the most part they’re pretty sane and retain most of the original bindings. This was not the case with elfeed, and reading documentation proved to be somewhat a moot point as basically everything had been changed to line up with a vim-style workflow. It made me wonder - what other aspects of emacs are being substantially changed because of evil and evil-collection? Am I losing out on some gucci emacs feature because of evil-mode?
Concerns
I have three major concerns with switching away from vim/evil keybindings:
- Inability to rewire my brain away from vim habits.
- Missing out on features I’ve come to love (e.g. visual-mode commands and vim’s search/replace mechanism).
- Finger strain - the famed emacs-pinky.
For the first one I figure there’s only one way around - practice. I took a look at god-mode and meow-mode to see if there was a way to “have my cake and eat it too” so to speak, but I realized these would be similar to vim and at the same time different enough that I am unlearning and replacing vimisms with vim-like alternatives rather than learning a whole new set of bindings. Meow would still require me to have some proficiency with emacs bindings for the non-text buffers. As I went through the emacs tutor again, I came to the conclusion that emacs and vim bindings are probably different enough that I should be able to compartmentalize them fairly well. The same cannot be said of vim and meow as I would chose one to the detriment of the other.
For the second one, this is more of a concern with having to learn new ways of doing the same things. Considering emacs is a lisp-interpreter ultimately and isn’t bound by the same restrictions as vim or any other program, I’m confident solutions for my favorite vim features exists in emacs - it just won’t start with a colon or some other vim key.
Regarding the last one, I figure this is something I’ll be able to learn soon enough to prevent any issues should they arise. However, I heard from one of Prot’s vids that the best hack for emacs bindings is learning proper typing habits using both the left and right hand. This is something I had been working on anyway; C-c as your leader key gives you a ton of practice breaking away from just using the left hand, for example. With caps lock remapped to control, I’ve had very little issue using both hands for CTRL and ALT key operations, even when those keybindings involve switching hands in the middle of a key combination. As an added bonus I am no longer engaging caps-lock and doing all kinds of unintended stuff.
So if anything I look at this as a really good opportunity to perfect my typing The next step will be split-keyboards, but that’s a level of autism I shouldn’t approach lest I go down another potentially expensive rabbit hole.
One Week Review
So far I have no real complaints not using vim/evil mode. It hasn’t taken long to get familiarized with the default keybindings for various programs; really that aspect of emacs is no different, just using b/n/p/f instead of h/j/k/l. One of my main fears was that I would always need two-hands to do any kind of scrolling or navigating, but this really isn’t the case. In almost all buffers, “n” and “p” will move up/down without the control key, so one-handed browsing has not really been an issue.
I’ve stopped mashing ESC all the time like I am accustomed to.
Learning the emacs bindings is surprisingly easy because they’re largely pneumonic-based. Even in programs like dired: up-directory is ^, a symbol that looks like an up arrow, for example. Not always the easiest to reach, but easy to remember.
Editable buffers took about a day to knock off some rust iron oxide, but it’s been fine.
Slower for sure, but not drastically.
I suppose akin to the non-soystemd inits booting quicker - it is true dinit and runit boot quicker, but not to the extent that it drastically changes your computing experience.
A lifetime of booting with dinit over soystemd will save tens of minutes.
Likewise I think the extra time it takes with emacs bindings is a drop in the bucket, at least for my uses.
Completely different story for programmers.
I can already tell emacs bindings have some advantages over vim - probably fewer compared with vim’s advantages but for the right person the advantages of emacs bindings could be substantial. For writing prose I can see how emacs bindings are really nice - there are a ton of sentence/paragraph oriented operations that don’t have parallels in vim (and don’t need to tbh considering the target audience of sysadmins and programmers). Plus transposition of characters and words.
I think the biggest strength of emacs bindings (so far) is the kill ring. Yes, there’s a way you can access it in evil, but you have to customize that yourself. And this is a feature that carries over to bash which does not have an equivalent in readline vi-mode (to my knowledge).
Long-Term Prediction
I’m going to give it some time, probably close to a year to get an honest review, but if I had to guess I am most likely done with evil/vim bindings in emacs. I’d also like to toy with the built-in viper-mode which emulates vi-bindings. My vimrc is split up between vi-compatible options and vim-specific stuff, so I’m already very familiar with the vi limitations and honestly, it doesn’t bother me much. But that probably will not be a long-term solution if viper-mode affects more than just the editor. I can already tell that emacs “feels” better integrated and more consistent with the default bindings.
So if you’re like me and seemingly tied to vim-bindings, try breaking out of your comfort zone a bit and cracking open the emacs tutor with C-h t. Emacs tutor is extremely useful even beyond the editor bindings, but it’s unfortunately kind of useless if done in evil mode.
You might be surprised.