Reputation: 973
I have gotten into the habit of using ctrl+f to move forward a character when staying in insert mode while using the vim mode in various editors. I don't like using the arrow keys or hopping out of insert mode/moving a character with a motion command/getting back into insert mode. How do I make that shortcut work in VS Code? I also often will use ctrl+b to move backwards a character, but this is less important. I'm open to other suggestions, btw, for moving around while in insert mode without the arrow keys.
Upvotes: 1
Views: 1787
Reputation: 181349
In keybindings.json:
{
"key": "ctrl+f",
"command": "cursorRight",
"when": "editorTextFocus"
},
{
"key": "right",
"command": "-cursorRight",
"when": "editorTextFocus"
}
Steps to reproduce:
Ctrl-K Ctrl-S opens keyboard shortcuts (or click the gear icon in lower left).
Search for cursor right.
Mouseover "cursor right", click on "+" or "pen" edit icon.
Enter your desired keybinding in the popup dialog, press enter.
Vscode will automatically produce the keybindings above in your keybindings.json file.
Upvotes: 4