Code faster in Visual Studio Code using Vim emulation.
I use both VS Code and Neovim for coding. VS Code mostly at work and Neovim for personal projects. One thing in common is I prefer to use a modal editor to code.
For VS Code, to support modal editing, there are mainly 2 extensions we can use — VSCodeVim and vscode-neovim. vscode-neovim embeds a Neovim instance inside VS Code whereas VSCodeVim is a Vim emulator (Neovim integration is still experimental).
For beginners, you should start with VSCodeVim as it is much simpler to configure. This article explores how to improve productivity using VSCodeVim and its supported plugins. It is an introductory guide to modal editing, but basic Vim knowledge is still required.
Here are few sensible defaults that you can customize to fit your workflow. Open
Ctrl|Cmd ,), and select
With this setting enabled, whenever you yank/copy a selection, the region is highlighted temporarily. This is helpful for you to validate the selection is correct.
Smart Relative Line Numbers
Enable this setting to show relative line numbers while editing.
It makes sense to set the
Leader key to
Map Home Row Keys to Escape
I prefer to map
Escape. You can use either
Insert Mode Key Bindings Non Recursive or
Insert Mode Key Bindings to achieve this.