There are two vim emulator plugins for VS Code that are well known -- amVim and VsCodeVim. I've been using amVim for years, but discovered today that the other emulator works better with one tiny tweak to the default extension settings.
It messes with the multi cursor features in VS Code.
Although I've happily been using amVim and even contributed to it, today I tried the Cursor editor again. Cursor installs VSCodeVim if you enable Vim bindings during setup. Initially I thought Cursor had a bug with multi-cursor selections, but it turns out it's still a problem with the default settings in the VSCodeVim extension.
Then I remembered this was the main reason for me using amVim forever.
Typically I select text, then press
Cmd + D to select the next matches with multiple cursors. When VSCodeVim is enabled, this sometimes goes haywire.
Watch what happens when I try to select a few occurrences of
' in this video 👇
Notice how the selection changes and doesn't even select the right thing -- maddening!
The VsCodeVim version binds a function to
Cmd+D by default which competes with our other (default multi cursor) shortcut.
Follow these steps to fix it:
Cmd+Shift+P to open the Command Palette, then search for
shortcuts. The one you want is titled
Preferences: Open Keyboard Shortcuts.
"Cmd+D" (yes, with the quotes). This shows all shortcuts bound to that key combination.
extension.vim_cmd+d and choose
Fixed. Feels goooood. 👇
You might be wondering, "what's the point of switching?" Well, VsCodeVim has much more complete Vim implementation, and amVim doesn't get a ton of updates nowadays. For example, these are a few of the things amVim doesn't have (at this time):
Ctrl + U,
Ctrl + D
/ being a shortcut to open the VS Code search. Gonna use this a ton.
:ju to see them all,
Ctrl + o to go back,
Ctrl + i to go forward
Will update this article with any other notable feature differences or annoyances I encounter. Thanks for reading!
👋 Happy Coding!