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
Extensions
side menu option, orView|Extensions
window menu option, or enter the keyboard shortcutshift+cmd+x
. - In the extension pane’s search field, enter
vim
or, more specificallyvscodevim
. Find theVim
extension, with the description ‘Vim emulation for Visual Studio Code.’ - Click the
Install
button, 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
j
ork
keys 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 true
.]
Additional settings and documentation may be found at the extension’s GitHub repository.