Vim vs NeoVim

I have been a Vim user for many years, although I am by no means a Vim power user. Two years ago I switched my editor from Vim to NeoVim.

Vim is a general purpose editor, used for pretty much everything, from editing configuration files on remote SSH sessions and git commit messages to giving an actual full coding experience. And while it is great for the first two, it isn't exactly optimal for the third. The reason is its dated plugin system. For example, for a long time, Vim did not support asynchronous background tasks (it is now available in Vim 8). And its plugin language - VimScript - is not exactly friendly. And these improvements were slow in coming.

Enter NeoVim. NeoVim is a fork of Vim that has a faster release cycle and adds in all those features that the Vim community has wanted for long. At the same time it's backward compatible, so all the old Vim plugins that you used before will still work with NeoVim.

One of the first features implemented was asynchronous task system. This allowed plugins to perform calculations in the background - critical when you want to run lint the code in real time as you type, like any modern IDE does. Another improvement is adding a Lua interpreper so that plugins can be written in Lua instead of the archaic VimScript.

These changes made it much more viable for plugins to offer modern IDE like features. While Vim is a general purpose editor, NeoVim's audience is strictly coders. This places it in direct competition with other lightweight code editors like VS Code.

I first moved to NeoVim when it was at version 0.4. At that time it worked, but still lacked many features. In the subsequent versions, many improvements have been added, like support for Language Server Protocol, Debug Adapter Protocol, Treesitter and many more. The newer plugins are completely in Lua which makes setting them up so much easier. The current version is 0.9 and its at a point where I could easily recommend it to anyone.

One question that is often asked is what is the difference with VS Code? VS Code even has plugins to enable Vim compatibility mode. To me, what I like is that its a lot faster to start up, its much more lightweight even compared to VS Code, and its much easier to customise with the features that you want. I don't have anything against VS Code, I still use it from time to time on other computers where I do not have access to install NeoVim. But given a choice, I'd pick NeoVim any day.

One downside is that NeoVim needs to be configured. If you want basic things like autocomplete, you need to search and install a plugin, and configure it. VS Code comes preconfigured out of the box. Thats one of the big advantages of VS Code. Recently we are seeing "distributions" of NeoVim, that bundle a preconfigured set of plugins to make NeoVim behave in different ways. These are great starting points for jumping on to NeoVim, and you have a base to start with when you invariably want to customise the configuration.

I'll write more about all these in a later blog post. Till then, here is a pic of what my NeoVim looks like.

Editing python code in NeoVim