This week was my 1 month anniversary of using Neovim. In light of that, I thought it would be a great time to document my experience so far of switching from VS Code to Neovim.
Learning the motions
It was at the end of December 2023, I decided to try out the vim plugin for VS Code - an extension that let's you use vim motions within your regular editor. Little did I know at the time, I had stumbled down a path of no return.
After watching some videos, and spending some time on vimtutor I could get some basic movements in. It felt good, it felt fun, I felt powerful.
However, I was not yet skilled enough to harness the power in front of me. I would start typing and suddenly things would disappear or parts of the document would be changed in ways I did not expect. Oops wrong mode. This grew tiring, frustrating even. I was unproductive, and had things to do. I disabled the plugin.
Disabling the plugin was worse. I had been confronted with a reality I didn't see before, and now I couldn't un-see it. I longed for the power, and fun, of the motions that would let me be expressive with how I wrote my code. Writing code the old way was not an option any more. I had to push forward.
I switched back and forth several times between enabling and disabling the plugin while learning a handful of commands and motions.
After watching some videos, and spending some time on vimtutor I could get some basic movements in. It felt good, it felt fun, I felt powerful.
However, I was not yet skilled enough to harness the power in front of me. I would start typing and suddenly things would disappear or parts of the document would be changed in ways I did not expect. Oops wrong mode. This grew tiring, frustrating even. I was unproductive, and had things to do. I disabled the plugin.
Disabling the plugin was worse. I had been confronted with a reality I didn't see before, and now I couldn't un-see it. I longed for the power, and fun, of the motions that would let me be expressive with how I wrote my code. Writing code the old way was not an option any more. I had to push forward.
I switched back and forth several times between enabling and disabling the plugin while learning a handful of commands and motions.
Introducing Neovim
One rainy weekend in early January I decided to spend a little time configuring Neovim. With no real intention to make this my default editor, just a curiosity to be satisfied. I still hadn't fully got to grips with the motions, but I knew enough to fumble my way through configuring the editor within the editor.
I read through https://github.com/nvim-lua/kickstart.nvim, and copied a few bits and pieces over into my own config. I'm not much of a one file for everything kind of person though, so I quickly went my own way. Fortunately around this time ThePrimeagen, was live-streaming the rewriting of his own config on Twitch, and typecraft had launched his own Neovim Course on YouTube. So armed with a bunch of content, and a healthy dose of RTFM (reading the friendly manuals) I set off building my own config tailored for my own needs.
I should note most of my development right now consists of Ruby on Rails, and/or Javascript. So those are things I have primarily configured so far.
I read through https://github.com/nvim-lua/kickstart.nvim, and copied a few bits and pieces over into my own config. I'm not much of a one file for everything kind of person though, so I quickly went my own way. Fortunately around this time ThePrimeagen, was live-streaming the rewriting of his own config on Twitch, and typecraft had launched his own Neovim Course on YouTube. So armed with a bunch of content, and a healthy dose of RTFM (reading the friendly manuals) I set off building my own config tailored for my own needs.
I should note most of my development right now consists of Ruby on Rails, and/or Javascript. So those are things I have primarily configured so far.
Leaving VS Code
Since that rainy weekend, I could probably count the number of times I have opened VS Code on one hand.
Something interesting happened by switching to Neovim. My default patterns took a forced hard reset. Any resemblance of similarities had gone. Back in VS Code with the Vim plugin I would still use old keyboard shortcuts like Cmd-Shift-p to open up the command palette / file explorer, or Cmd-b to toggle the sidebar. This conflict in patterns and muscle memory meant I would often try to revert back or forget that modes were a thing. By switching to Neovim this went away, I was working from a blank slate, and it gave me space to just learn the tool rather than relying on what I already knew from VS Code.
Something interesting happened by switching to Neovim. My default patterns took a forced hard reset. Any resemblance of similarities had gone. Back in VS Code with the Vim plugin I would still use old keyboard shortcuts like Cmd-Shift-p to open up the command palette / file explorer, or Cmd-b to toggle the sidebar. This conflict in patterns and muscle memory meant I would often try to revert back or forget that modes were a thing. By switching to Neovim this went away, I was working from a blank slate, and it gave me space to just learn the tool rather than relying on what I already knew from VS Code.
My takeaways
So what can I share after a month? Well here's my top 5 takeaways:
- Vim motions can make you fast, very fast, but they're also incredibly fun.
People have described Vim / Neovim as a skill-based editor, and it is. It is very much like a video game that you can improve and get better at. There's lots to learn, and lots of ways to play and develop your skills. And, those skills often map beyond Neovim or Vim into other CLI tools.
It's also very expressive. It feels good when you can look at what you want to happen and just have your fingers move in a couple of keystrokes to make it happen. - Using the vim plugin for your editor is good, but may be a blocker after a while.
Some of the areas I got tripped up the most were because I was trying to use the vim motions while also using my old editor. Switching over to Neovim forced my brain out of those old habits and sped up my process 10x.
- You really only need a couple of weeks to become as fast as your old editor.
Once concern that comes up a lot is around the time it takes to learn the skills. To that I believe you really only need a couple of weeks of intentional effort. I came across this post last week and it's a good one I recommend checking out https://thoughtbot.com/blog/the-vim-learning-curve-is-a-myth. - You'll need to question some prior practices.
I was a die-hard multi-cursor user, and while you can kind of do that with Neovim there are often much better tools for the job. I'll often reach for a search/replace using a command now instead. - Neovim brings the power and ethos of the motions to every action.
This journey started with learning a handful of motions in VS Code. Now that power has extended to the majority of my development workflow. Changing files with telescope, or harpoon. Stashing, staging, committing or pushing code with git. There are features I use in Neovim that I never even considered using in VS Code, and it can all be made just a motion away.
And so, going forward, I will be continuing to use Neovim as my editor of choice.
Should you wish to see it, I have made my Neovim config public on GitHub: JoshAntBrown/neovimrc.
I should note, that while my config is public, I can't promise it will work for you out of the box, and it's not intended to be so. Instead, it is available for you to read and cherry pick parts that you might like that you can add your own flavourings to.