visual-studio-codesettingsvscodevim

Is there a way to remap Caps_Lock to be the escape key on vscode's vim?


Problem

I want to use Caps_Lock as the key to exit insert mode in Visual Studio code's vim extension. I have already remapped the keys in Xorg with Xmodmap, but Visual studio doesn't seem to really matter.

My VScode settings

As you can see, I already tried with "vim.insertModeKeyBindings", but it only disables the Escape key, leaving me thinking that Caps_lock has another key name/keysym, but I can't seem to find it.

{
    "editor.fontFamily": "'Inconsolata-g for Powerline'",
    "editor.fontSize": 16,
    "liveshare.authenticationProvider": "GitHub",
    "vim.enableNeovim": true,
    "code-runner.enableAppInsights": false,
    "code-runner.runInTerminal": true,
    "workbench.startupEditor": "newUntitledFile",
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],
    "workbench.colorTheme": "BeardedTheme Anthracite",
    "extensions.autoUpdate": "onlyEnabledExtensions",
    "vim.vimrc.enable": true,
    "vim.vimrc.path": "$HOME/.config/nvim/init.vim",
    "editor.fontWeight":"bold", 
    "vim.insertModeKeyBindings": [
        {
            "before": ["<Esc>"],
            "after": ["<Caps_Lock>"]
        }
   ]
}

Another thing i'd like to address is that i already have j,k and their combinations to exit insert mode. Is that a default?


Huge thanks in advance to anybody offering to help!!


Solution

  • Solution

    As this problem arose in Linux and, I already changed my settings in Xmodmap, it seems that VScode not respecting remappings with xkbmap is a known issue and should be fixed by adding "keyboard.dispatch": "keyCode" in VScode's settings.json and reopening VS.