How to enable Tabs and Command Mode in Vim extension for VSCode

Photo by Sigmund on Unsplash

How to enable Tabs and Command Mode in Vim extension for VSCode

Problem:

  1. When using VIM extension for VSCode in command mode it does not allow to use tabs by default
  2. Need to set more comfortable kj keybinding to switch into command mode instead of using <ESC> key.

Vim configuration in VSCode

  1. How to make tabs work in VIM extension:
    // Edit and save settings in keybindings.json VSCode
    // Place your key bindings in this file to override the defaults
    [
     {
         "key": "tab",
         "command": "tab",
         "when": "editorTextFocus && !editorTabMovesFocus"
     },
     {
         "key": "shift+tab",
         "command": "outdent",
         "when": "editorTextFocus && !editorTabMovesFocus"
     }
    ]
    
  2. How to set kj keybinding for command mode:
    // Edit and save settings.json in VSCode
    {
     "vim.insertModeKeyBindings": [
         {
             "before": ["k", "j"],
             "after": ["<Esc>"]
         }
     ]
    }