Emacs and Neovim

Some say Neovim is better, others Emacs. I don’t care, I use both.



I entered the world of programming, by curiosity while exploring Linux. My very first code was written using Neovim, and so I’ve been using it forever for more than one year.

In the beginning, it was quite a challenge to learn the basic vim motions, specially hjkl. It took me a long time to properly be able to move around, but once it was a thing, I couldn’t leave it. I wanted it everywhere, including my browser. For my experience with Neovim configuration: I started with a from scratch config using lua, than I moved to LazyVim distro, thinking it was easier to setup some other functionalities, but I was wrong. LazyVim does a lot of stuff for you in the background, and you have no control over them. Lately, I’ve quit LazyVim moving back to my from scratch configuration. And it took me one line change to do it, but a couple more to bring the main functionality from LazyVim back. I realized that many plugins were actually bloat, and that I didn’t need them. So now I have a fairly simple config and to the point, where it’s actually useful, and not just visual appealing.

Up to this point, I’m still more inclined to Neovim, but maybe because I’m just used to it. Before the date of this post, all my projects were written using Neovim. Not a single one written using VSCode or any other IDE. I was golden for all this time.

What about Emacs? I tried Emacs around four times. Three times with the Doom Distro, and three times frustated by it. The loading times were too long, taking roughly 5 seconds to load, it was hard to understand what was going on in my configuration, and what each module in the init.el was doing under the hood. The last attempt was different. I started with a very vanilla Emacs configuration, which I stoled from here. I was impressed. I have never used default Emacs bindings before, they blow my mind. I could do many fancy movements with the cursor in “insert mode” (Emacs doesn’t have it, but it’s like it for a vi user), that I didn’t had in Neovim, and makes all the difference, but at a cost. I didn’t took very long to I feel my left pinky slighly in pain (the Emacs pinky isn’t a lie, after all).

At this point, my Emacs experience was kinda hard to follow up. I decided, then, to bring the most useful Emacs bindings to my Neovim configuration. Said, and done. Now I can use Emacs in Neovim. I also have setup some plugins that kinda mimics some Emacs builtin packages like compile-mode and dired, known as compile-mode.nvim and oil, and also the popular magit, which is cloned as neogit.

I also had to change my bash and zsh configurations to use the Emacs bindings. They are there, by default with a nice support without the need to install a plugin. At this, point even nano makes sense.

Slowly I finally came to the point I understand how Elisp works and how to setup the config file, and how simple it was. Made some adjustments, added some other packages that didn’t took too much of the essential simplicity of the stolen config. Shortly, I realized that Emacs bindings, although powerful, are not really that ergonomic. I though of bringing some vi bindings to it, but it would clash with many Emacs bindings already set. I tried god-mode, which provided a modal editing experience, that allows you to use less modifier-keys, but I was barely using it, because you have to enable it manually, and there are moments where I’m already used to using the modifier keys, I forgot about it. After a little of struggle I decided to but evil-mode. At the first glance, just enabling it was like fresh air. I’m still considering, wherether to really just use evil-mode and have a true vi experience, or modify some Emacs bindings to use the vi ones, like hjkl to C-hjkl, and so on.

But by a way or another, I use vi in Emacs, and Emacs in Neovim, and still use the default bindings when apropriate.

The whole point is: Vim is great, except when you have to enter insert-mode. In insert-mode, no Vim motions apply, and there is nothing there to help you edit text. For every line movement, like going one line up or down, takes at least an Esc and then an i. It’s too much, compared to Emacs’ C-n and C-p. Another thing that is relevant to talk about is how well integrated Emacs feels within its builtin packages and even third-party ones. Everything integrates so well in a way, I’ve never seen something similar in Neovim. It’s such a much superior experience, and I’m talking only about text editing (forget the Emacs OS, I’m not there yet). I would rather prefer go as an Emacs purist, but I got so much corrupted by Neovim, it’s no longer possible.

This post is licensed under CC BY 4.0 by the author.