Search code examples
visual-studio-codekeymappingvscodevim

Can we add custom keybinding on VSCODE's VIm Extension?


I was using Vim in visual studio code, i want to use 'jj' to exit from insert mode. How can add this custom keybinding in visual studio code.

I tried to add it in VS CODE shortcuts. but i can't see any option to add our own shortcuts.


Solution

  • You can modify your user settings to add this custom. Adding the following code to your settings.json will help you use jj to exit insert mode.

    "vim.insertModeKeyBindings": [
            {
                "before": [
                    "j",
                    "j"
                ],
                "after": [
                    "<Esc>"
                ]
            }
        ]
    

    If you want to learn more about how to customize your vim in vscode, official docs may help you a lot VSCodeVim