homeposts

Created: 8/13/2022

Vim vs. Neovim

TL;DR

Neovim has very powerful plugins. You can combine them to form an IDE-like experience, but neovim otherwise doesn't offer a benefit if you don't plan to do that.

Vim is an extraordinarily capable text editor which will suit your needs just fine if you can live without language support and in-editor debugging tools.

Relevant POV for Newcomers

From a new user's perspective, neovim is almost 100% compatible with vim for all intents and purposes. That assertion breaks down once we start looking at plugins, but the overall user experience before plugins is comparable. To that end, it doesn't really matter which one you start with.

Neovim's Achitecture & Lua

The api that neovim exposes for extension by plugins is very different from vim, and has enabled very powerful plugins to fourish. See :h api. Part of this effort includes adopting lua as a first-class scripting language alongside vim-script. Together, this means very mature and powerful plugins – truly the best of the open source ecosystem at work.

Neovim is also a community-led open source project, whereas vim follows the so-called "benevolent dictator for life" model, where vim's founder Bram Moolenaar makes final decisions about the future of the project, for better or worse.

Don't Underestimate Vim

I don't want to give plain old vim the cold shoulder, though. One of the delightful things about going down the (neo)vim learning journey is that you apparently never stop finding features that are both surprising and quirky, and in my experience, a lot of these nuggets of gold are inherited from vim. For example:

  • Did you know that g?<motion> will rot13 encode text?
  • Did you know that gu<motion> and gU<motion>, can convert text to lowercase or uppercase, respectively?
  • Did you know that gx opens the URL under your cursor?
  • Did you know you can open and edit a remote file without leaving vim with :e scp://<user>@<host>//absolute/path/to/file.txt
  • Did you know that you can yank (y), change (c), or delete (d) text inside curly braces, parenthesis, or square braces with key sequences like:
    • di{: delete inside curly braces
    • ci(: change inside parenthesis
    • yi[: yank inside square brackets
    • p, intuitively, will paste (or "put") that text where the cursor is after yanking

Vim is Simple & Universal

That is a random smattering of functionality, but the idea that there are so many random fun things like this to learn, and that they are available on every Unix-like terminal you touch is the legacy of vim (and vi that came before). I definitely don't sleep on plain-old vim.

What Do I Do?

In the end, I use both vim and neovim. My vim setup is simple and portable. It contains a few optional plugins for things like git, improved syntax highlighting and python indentation. Particularly if I'm working on a remote machine, I get a lot of use out of that simple setup. For any kind of local development, I use neovim, which inherits and extends my vim config to include more IDE-like features.

Again, as a beginner, it ultimately boils down to to-may-toh vs. to-mah-to.