This page looks best with JavaScript enabled

Vim in VS Code

 ·   ·  ☕ 2 min read

It has been quite sometime since I used vim or one of its flavours as my main editor for development. Is it time to go back to Vim? I am attracted by Vim’s productive usage of keyboard, but not so much about having to sacrifice VS Code or a few important shortcut keys in VSCode that Vim takes over.

I used Vim on and off - but never as a fully-featured editor. For all its never-gets-old capabilities and the power of Vim scripts, I could never successfully scale the initial curve to fully appreciate its greatness. So my reasoning was to use Vim but stick to VSCode in the meantime so that I don’t lose all its features in one go - that is a system shock.

I focused initially on the most popular extension - VSCodeVim.

VSCodeVim is a really good extension that brings the power of Vim to my favourite editor. All started well - I was able to have never-before-had power of navigation using Vim. Within a day or two, however, there were issues -

  • Vim takes over shortcuts in VS Code that I really like (e.g. Ctrl + D to iteratively select strings, or even Ctrl + F that has been deeply ingrained in my muscle memory). While there are comparable options within Vim, they were not at the same level as VS Code :)
  • Unfriendly copy/paste across documents

I was really caught in a quagmire -

  • continue using Vim and be a cool guy,
  • focus on short-term productivity (Vim has a learning/re-learning curve). Rely on VS Code to deliver more usability improvements that negate the need to adopt Vim

I found other souls had been in a similar situation and applied much better solutions than what I could conjure.

The result - I am now using a far-less popular, but an interesting plugin - Simple Vim.

Simple Vim allows me to -

  • Use VIM within VS Code (albeit in an opinionated way)
  • Quickly go back to VS Code way of doing things by going into ‘edit’ mode (Esc + I is all you need)

I found this approach much better in terms of going back to VS Code defaults, but gradually getting accustomed to more of Vim tools while doing real-world programs.

Stay in touch!
Share on

Prashanth Krishnamurthy
Prashanth Krishnamurthy
Technologist | Creator of Things