For those who enjoy using vim but would like to (or need to) use Visual Studio Code, there is an option, and that is a vim emulation extension available in the Extensions Marketplace. To install the extension, follow these steps:
- From VS Code, select the
Extensionsside menu option, or
View|Extensionswindow menu option, or enter the keyboard shortcut
- In the extension pane’s search field, enter
vimor, more specifically
vscodevim. Find the
Vimextension, with the description ‘Vim emulation for Visual Studio Code.’
- Click the
Installbutton, and reload if prompted. vim key bindings should now be available while editing code.
- Key repeat may not work as it typically does in vim, for example when holding down the
kkeys for vertical navigation. In that case, the following command may be run from a terminal at the command line to enable it:
defaults.write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
[To undo this setting, the command can be run again with the
-bool switch set to
Additional settings and documentation may be found at the extension’s GitHub repository.