Key Takeaways

  • While it has a daunting reputation, Neovim is a powerful text editor well worth learning.
  • Neovim is a drop-in replacement for Vim, with an overhauled architecture and support for plugins written in Lua.
  • Plugins can add entire new categories of features to Neovim.

Whether you’re a seasoned coder, just getting into programming, or simply want to edit a few files, a good text editor is an essential tool. While it has a daunting reputation and, yes, a little bit of a learning curve, Neovim is absolutely worth learning, maybe even more than its storied predecessors.

What Is Neovim?

To explain what Neovim is, we need to take a step back and explain what led to it. In the history of Unix and Unix-like operating systems (Linux included), fewer pieces of software are better known than vi. This text editor dates back to 1976, and you can almost guarantee this is the default text editor you’ll find on any Linux system.

Among other key features, vi makes use of modal editing. This means, in a nutshell, that you operate in either insert mode, which is where you “insert” text, or normal mode, where instead of entering text, the keys perform various editing-related actions. Even better, you can chain these commands in a language of sorts to enable powerful editing in just a few keystrokes.

As powerful as vi was, its barebones nature isn’t the best suited to larger or more involved projects. Vim wasn’t the first vi clone, but this version, which stands for vi Improved and was written by Bram Moolenaar and originally released for the Commodore Amiga in 1991. Vim added many features we take for granted in a text editor these days, like syntax highlighting, autocompletion, and Unicode support.

Neovim is, in many ways, as Vim was to vi. Neovim works as a drop-in replacement for Vim, to the point that you can keep using your old .vimrc file if you like. That said, Neovim also supports writing your configs in Lua scripts, while does offer a good deal more power, especially if you’re already a coder.

There is an active community of developers around both Vim and Neovim, and the projects don’t seem to be in active competition. While Neovim tends to get new features first, and some more experimental features may never make their way to the more seasoned editor, they both seem quite healthy.

Key Differences Between Vim and Neovim

To start, there are more similarities between Vim and Neovim than there are differences. Despite being a Vim/Neovim user for years now, I keep a copy of Drew Neil’s Practical Vim on my desk. Despite the distinct lack of a “neo” in the title there, I have yet to read a tip in that book that hasn’t been applicable in Neovim.

For developers, Neovim aims to be simpler to maintain and extend, with more advanced user interfaces possible. This means that for users, we get fancy new features faster, while the simplified codebase should make maintenance easier to ensure we get to keep using those features.

In practice, the main differentiator between Neovim and Vim is, as already hinted at above, the plugin ecosystem. Not only is Lua a more widely known language than Vimscript, but in general, the plugin architecture Neovim uses gives plugins more control over the environment. This means plugins can transform Neovim in brand-new ways.

Screenshot of clipboard and indenation options in the Neovim config

In addition to the option to use Lua for your config file, Neovim also uses a different directory structure. While Vim tends to look for a .vimrc in your home directory, Neovim follows the XDG Base Directory specification. If you’re using a Mac, this won’t make a bit of sense to you, but for Linux users, this means your Neovim config sits in $HOME/.config/nvim in the same way as many other programs.

Neovim Basics

Neovim isn’t as widespread or common as Vim (at least, not yet), but it’s still available on most major Linux distributions.

Installing Neovim

On Ubuntu or Debian systems, run:

sudo apt install neovim

On Fedora, run the following:

sudo dnf install neovim

For Arch-based systems, run:

sudo pacman -S neovim

For optimal performance, once Neovim is installed, run the app with the nvim command, then press Escape to make sure you’re in Normal mode, then enter the following:

:checkhealth

If there are any additional programs Neovim relies on that aren’t installed, this command will let you know. In case you run into issues in the future, this is useful to know.

Learning the Basics

Vim, and by extension, Neovim, has a reputation for being a difficult piece of software to learn. I’d argue that this is mostly untrue. Yes, getting used to modal editing takes a little while, but beyond that, learning the keybindings is no more complicated than learning keyboard shortcuts in any other application.

Fortunately, both Vim and Neovim come with a built-in tutor to show you the ropes. There is too much to learn about Neovim to cover in the scope of this article, but the built-in tutorial is a great place to start.

To start learning, run nvim, assuming you haven’t, then run the following:

:Tutor

And hey, at the very least, you’ll learn how to exit the program.

Screenshot of the built-in Tutor feature in Neovim

Configuring Neovim

Unlike standard Vim, which uses a single monolithic .vimrc file, Neovim can use a more modular approach, assuming you’re using Lua files. This doesn’t have much of an impact on actual editor performance, but it does help to organize your configuration if you’re using a lot of customizations and plugins.

Of course, if you’re new to Neovim, you probably won’t have a whole lot of customizations to add yet. That said, if you’re interested in writing Python code, you may want to install a few plugins that make writing Python code simpler. Neovim’s modular architechture makes it easy to isolate these into their own config files in a subfolder, so if you decide you don’t like a certain one, it’s easy to remove it from your config.

Again, crafting the perfect Neovim config is beyond the scope of this article. If you’re like most people, you’ll probably put a config together by lifting bits and pieces out of various dotfiles you find on GitHub. Fortunately, there’s an easier option.

Customizing Neovim Made Easy

It started with people sharing their own configs, but over the years, various editors have seen “distributions” pop up, not entirely unlike Linux distributions. These exist for Neovim as well, effectively preconfigured config files that you can drop into your home directory, test out, and then tweak to your liking.

Two popular Neovim distributions are LazyVim and NvChad. If you look at screenshots for either of these distributions, you might be surprised that you’re still looking at Neovim. With icons, a sidebar, and visual tabs at the top of the screen, you’d almost expect you were looking at a VS Code screenshot.

LazyVim aims to be the most complete out-of-the-box, to the point that if you’re familiar with Neovim already, it may feel too different. That said, the distribution is great for beginners, with a built-in package that gives you handy hints about what pressing a given key will do once you start entering a key combination.

NvChad, on the other hand, is a little less full-featured out of the gate, but still offers a heavily modified experience beyond vanilla Neovim. If you want something that feels like a modern editor but you want to dive into the Neovim waters a little deeper on your first try, give this one a try.

Screenshot of NvChad

Even if you opt to start with the barebones editor, Neovim and Vim are well-worth learning, even if you move on to other editors in short order. You never know when knowing a thing or two about a text editor dating back to the 1970s could come in handy.