vimvisual-studio-codevscodevim

How do I add a keyboard shortcut to activate/disable a VSCode extension?


I want to be able to turn certain extensions on and off with a keyboard shortcut. But didn't found out how to do keybindings for extension activation

Specifically I wanna do this for VSCodeVim. So that I can use it more often and become more used to using Vi


Solution

  • To toggle Vim mode in Vscode do the following:

    1. Use 'CTRl+Shift+P' to open vscode command palette

    2. type 'vim toggle', you will see 'Vim: Toggle Vim Mode' option

    3. select it and press enter to toggle vim mode.

    To add keybinding (shortcut) for toggling :

    1. open command palette using 'Ctrl+shift+p'
    2. type 'shortcuts'
    3. select 'Preferences: Open Keyboard Shortcuts' and press enter
    4. search 'toggleVim'
    5. click on 'Keybinding' column
    6. press the buttons you want for the shortcut and press enter

    Not every extension can be disabled by this method, But all extensions can be disabled or enabled for a particular workspace.