Header image.

BYE BYE VSCODE

Neovim seems to be increasing in popularity lately. About a month ago I decided to fully switch all of my text and code editing workflows over to Neovim from VSCode.

Why Switch?

VSCode is the most popular code editor right now. It has a massive plugin ecosystem, allows for a fairly high level of customization, works cross-platform, and syncs your plugins and settings between logged in instances. VSCode was working pretty well for me but there were a few nagging pain points maybe you'll resonate with.

It felt clunky to use for certain workflows. Smart Select works pretty well for instance but it also doesn't work well in certain situations (usually with TSX/JSX files). The hotkeys were not idiomatic to me. I had done some remapping but I'm not the best when it comes to creating keybindings so these remappings also weren't a huge improvement. The straw that broke the camel's back though was the ergonomic shortfalls of VSCode. Every developer should look after their hands. I have some joint issues so I am always very mindful of anything in my workspace that feels "off" in my body. VSCode feels "off" for my hands. I found that I was having to reach too much for many common commands (to use the Function keys) as well as having to contort my hands for uncomfortable key combinations.

My demands for a new code editor were as such:

  1. The fingers should rarely have to stretch beyond a one-key distance from their home position.
  2. Mouse interaction should be minimized as it creates an imbalance of symmetry in the shoulders.
  3. Configuration must be portable to other computers with minimal by-hand setup (must be somewhat competitive with VSCode's settings sync feature)
  4. Must support a wide range of plugins including my most commonly used LSPs and formatters.

The Competitors

I vetted four possible solutions: Helix, Neovim, Kakoune, and JetBrains WebStorm.

Webstorm was out right away. It seemed to be doing a VSCode-kinda-thing and had many of the same shortcomings. I didn't see any compelling reason to use it over VSCode.

Kakoune seemed alright but the smaller somewhat obscure community were a nonstarter for ensuring modern and up-to-date plugins were available and bug-free.

Between Neovim and Helix I actually liked Helix better. The act of selecting a word then acting on it, e.g. "word, delete" felt more natural to me than Neovim's "delete, word". Early on, Neovim's action-first approach felt a bit like unholstering and firing a gun before aiming at a target. I would actually come to see Neovim's approach as superior for reasons I'll explain later. Helix's approach to configuration was much more sane than Neovim. Most things "just worked" out of the box. Building a configuration file for LSPs was pretty straightforward, install them on your own then point your Helix config at the right command.

I decided to go with Neovim at that point for one reason; its total ubiquity. Learn and master the basic Neovim motions and you can fly on any Linux machine you SSH into. It won't have Neovim but it'll have Vim and you'll be able to do basic text editing with good speed and efficiency. Virtually every type of nerdware supports Vim keybindings, VSCode, Google Chrome (through an extension), your email (Mutt), your digital audio workstation (Reaper), etc. Learn once, profit everywhere.

One Month Reflections

Only a month in to using Neovim I have achieved the same level of editing speed as I posessed in VSCode. I have noticed multiple times over the past week when I am stalled while editing code, it's not because I have to find a key command or click through some GUI, it's because I can't think fast enough to keep up with my edits. Of course I had this problem all the time when I started coding and occasionally when working on "weird" problems, but it's common now. When coding, I have thoughts, those thoughts are queued in another part of my brain that is responsible for picking the next item in the queue and executing those as physical actions on input devices. I notice that my queue is empty a lot of the time now. Surprisingly I believe that due to one of the things I hated about Neovim at first - its action-first philosophy.

When I want to change the text inside of a pair of curly braces in VSCode, I grab my mouse, and click two-ish times (it never seems consistent) inside of the braces to select the text, move back to keyboard, press backspace to delete and then begin inputting my new text. In hindsight, this seems really dumb. I'm having to use some spatially aware part of my brain to move my hand to the mouse and then line up the cursor. It's not ergonomic or efficient. I Neovim, I move my cursor to line containing the first curly brace with offsetNumberOfLines followed by Enter for down or k for up, e.g. 36 Return for 36 lines down. Then I type ci{ for "Change Inside {" which deletes all characters inside of the braces and automatically pops me into insert mode to start typing my new text. I can do this very quickly now.

The plugin ecosystem is workable but has its downsides. It relies mostly on community maintained Git repos, which, to be fair, so does VSCode. Neovim involves a fair amount of configuration to get started with. I've finally pushed and pulled mine enough to be pretty content with it. I have attempted to keep it pretty stock to avoid lock-in to certain plugins that dramatically change functionality. The biggest concession I make with deviation from a "stock" setup is the inclusion of GitHub Copilot (which actually seems to work better in Neovim than it did for me in VSCode), and a number of LSPs/formatters/etc. such as ESLint, Prettier, gopls, and so on.

Finally, there is one massive benefit that I've been enjoying since switching to Neovim. Even the most ardent never-vimmer will have to agree that this benefit is a universal positive. The benefit is that I've had to get better at building regex off the top of my head. I have ALWAYS wanted to be "that guy" who could just put together the perfect regex to solve some gnarly find and replace operation without going to regex101.com with my tail between my legs. Now, some days, I am that guy. Gone are my days of Option + Clicking on the fields I wanted to edit in VSCode to generate multiple cursors, the day of the regex is nigh. If everything else about Neovim was horrible, this alone would make it worth it.

The opinions expressed on this blog are solely my own and do not reflect the views or opinions of my current or former employers. Any content provided here is for informational purposes only and is based on my personal experiences, research, and understanding. The information presented does not constitute professional advice or endorsements from any organization with which I am affiliated. I take full responsibility for the content published on this blog and the accuracy of the information provided.