Like many developers in the Ruby community, and around half of the developers at my current place of employment - carwow, I use and love vim. There are a lot of different reasons why people use and love vim, mine is that it synergises with the philosophy that text editors should primarily focus on increasing productivity for manipulation of text.
About two months ago, one of our resident vim told me to try out Neovim. “It fixes all the issues with Vim, while being backwards compatible with all your plugins” was the sales pitch.
Being relatively new to Vim (~6 months of usage), I was very much in the honeymoon phase. I couldn’t really think of any issues with my newest revolutionary tool; but I’ve always kept an open mind (which is how I came to learn to love vim in the first place) so I gave it a go.
Fast forward to today, and I can freely admit that I’m a believer. While vim is a great tool, my time with Neovim highlighted things I never knew I wished Vim had. Neovim has managed to improve the Vim experience, while keeping the core essence of what makes vim special to me.
So I thought I would share my findings with you with the hope that you give it a go too if you’re a Vim user:
Partly because it’s not really a switch. Neovim is almost a superset of Vim, and extends it with features you didn’t know you needed, while keeping backwards compatibility.
Neovim is an extension of Vim: feature-parity and backwards compatibility are high priorities. If you are already familiar with Vim, see :help nvim-from-vim to learn about the differences.
Want to ‘switch’ to Neovim from Vim? On macOS, it’s as easy as:
brew tap neovim/neovim brew install neovim mkdir ~/.config ln -s ~/.vim ~/.config/nvim ln -s ~/.vimrc ~/.config/nvim/init.vim
Did Neovim do something you don’t like? Need to use vim for a particular reason? Just run vim and continue as you did before.
Neovim comes with sane defaults which means that newcomers will find things a little more familiar and a little easier to get used to.
syntax enable gives you syntax highlighting out of the box, and
filetype plugin indent on turns on
indent - useful settings to have out of the box, especially for external plugins to work their magic.
If you’re an expert, however, feel free to customise every nook and cranny as you normally would.
You don’t know how much you want asynchronous plugin support until you have it. It makes a huge difference, especially when you have larger codebases that you may need to traverse.
Neovim has incredible support for async plugins, allowing heavy processing to be pushed to the background and results to update the UI when they are ready. Locking the UI while waiting for a plugin is a thing of the past.
Note: Back when I started using Neovim, there was no async support in Vim. Vim 8 now also comes with async support (why it took 8 major releases over 25 years to add is a different story in itself).
Open a split, type
:terminal and enter commands all without leaving the editor. It’s a nice workflow that has proved to be useful on several occasions. There is also a
t namespace for key bindings that only work in the terminal, e.g.
As with all software, not everything is sunshine and roses. Here are some reasons you may not want to use Neovim:
Vim is rocking it’s 8th major release however, as of the time of writing this blog post, Neovim is currently sitting at version
0.1.7. This may excite or scare you, depending on the type of person you are. Bugs will occur, and features are still yet to come. If you don’t like trying out immature software, the Neovim is probably not for you.
** This is fixed in neovim version 0.2 upwards **
To navigate my splits easier, like most vim users, I remapped the keybindings to feel more natural. In Neovim, remapping ctrl-h doesn’t work as expected. A workaround is required for expected behaviour, while the bug is being worked on.
Below is my workaround (macOS):
if has('nvim') " Hack to get C-h working in Neovim nmap <BS> <C-W>h endif
Neovim is awesome. It fixes little niggling issues that Vim has, while not straying away from the true Vim philosophy — which is vital. The maintainers are also dedicated to making the codebase a lot cleaner and easier to contribute to for newcomers. The future looks bright for the project, and I hope the contributors continue to make life easier for developers who believe in the vim philosophy.
Did you find this article helpful?