Vscode to Neovim

Posted on Sat May 09 2020

Choice of IDE or Text Editor is an important decision for any professional. Coding productivity always reduce when you are in a situation where you can't use your familiar setup. There are numerous choices but I think it comes down to three categories.

  • IDE, like Visual Studio
  • Mid/light weight code editor, like VS Code
  • Text editors, like Vim

What I have used so far?

I used to code in C# during my college years. What I remember is that you have to use a professional IDE if you want to do anything serious.

Later on I switched to PHP, I was using Sublime text as my primary code editor. I tried Atom as well, and settled with that. Around this time Microsoft introduced VSCode, it was getting good praise so I tried it. It is a very good code editor, I used it for years.

Moar RAM!!

I was happy with VS Code but there was always an issue with my setup. As a full stack developer, at any given time your system could look like this.

  • VS Code opened
  • Browser with at-least one tab open
  • Terminal running your build job
  • Slack, Music player running in background etc..
I use Lenovo Yoga 3-14 (8GB, Nvidia). My system was always under stress :)

Coding without mouse?

Go on Stackoverflow, Reddit or 4Channel, you will always hear about Vim/Emacs, doing everything from the home row. Never touching your mouse. Some examples

A few months back I got some free time to switch my usual setup. So I thought I will try Vim. I found a modern take on Vim, called Neovim. I FORCED my self to use Neovim. First week was hard, really hard. I had my project opened in VSCode along with Neovim. I kept hopping back and forth. Here are some tips that might help if you want to switch.

  • Try vim `:Tutor`, practice it daily.
  • Once you are a bit familiar with basic commands, try this game Vim adventures. Practice this game daily.
  • Now start editing your daily code in Vim, it will be hard at first but you will improve.
  • Tip- Use NerdTree, to break habit of using mouse for opening a new file
  • Some people suggest to install vim keyboard bindings in their old editors, not much helpful. If you are working in your editor, you will never want to try new vim syntax unless you don't have any other choice. I'll say jump in after you have played vim adventures game for a week.

Conclusion

I absolutely recommend Neovim. I think my productivity increased by about 20% - 30% after switch. It took me about 20 - 30 days to get fully comfortable. Neovim plugins are really good. You get full TypeScript / Flow support if you are using that. You will never miss your old IDE in that regard. It loads in an instant, which may never be possible for any Electron based IDE :)

Plugins which I use

  • vim-airline/vim-airline
  • tpope/vim-fugitive
  • neoclide/coc.nvim
  • preservim/nerdtree
  • maxmellon/vim-jsx-pretty
  • bronson/vim-trailing-whitespace
  • drewtempelmeyer/palenight.vim
  • coc-tsserver
  • coc-emmet
  • coc-css
  • coc-html
  • coc-json
  • coc-prettier
  • coc-eslint
  • coc-markdownlint
  • coc-yaml