The niceties of evil in Doom Emacs

A file in emacs

So today I convinced my partner to install IdeaVim into their IntelliJ setup, as they use Java at work. What followed was quite embarassing, as I kept telling them to use keybinds that just didn’t exist — as I was used to them in Doom Emacs (and so were they!). I figured I’d write an article about them, and how navigating around my code is so swifty.

evil-easymotion — This damn thing is so useful. I use it non. stop. It’s better than relative line numbers, as I don’t have to switch to the left and type 12j , I just look at where I want to go, type gsj and press the letter that pops up. This is also a nice replacement for visual mode, which I hear is a bit of an antipattern.

evil-easymotion in action

evil-snipe — Written by our lord and saviour Henrik, instead of having a line like Cook coca-cola chicken and wanting to jump to the “Chicken”. Sure you could press fc a few times, or maybe jump through with w . But instead, you could type sch and go straight there

evil-commentary — The best damn thing since sliced bread; well, since evil. Want to comment something? gc is your friend.

something commented with evil-commentary

So many ways to use this. select a region with visual block and gc? Vjjgc . But wait, visual block? well as we learned in the previous paragraph you can type gcgsj and select where you want to stop commenting! You can also use other text objects, like gcw . The world is your oyster!

evil-indent-plus — This is not such a common usage, but amazing all the same. Doom has 3 text objects set up. You can dii and it will delete everything on that indentation.

Here I can hit dii to delete everything inside the if statement

Or, if I undo ( u ) and hit dik It will delete the current indentation plus the line above. This is super useful for pythonic languages.

And if we undo again, and instead hit dij (which is not exactly useful in this situation, but I’m too lazy to find some other code) It’ll delete the current indentation plus the line above and below. Super useful for braced languages.


That’s all that comes to mind at the moment! Make sure you check out Doom Emacs and my config for it!