Reputation: 140
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
Upvotes: 2
Views: 5646
Reputation: 51935
Some extensions contribute a dedicated command to toggle their own functionality. As for something builtin to VS Code that isn't extension specific, I'm not aware of that existing at the time of this writing. The only commands I see to enable extensions right now are workbench.extensions.action.enableAll
and workbench.extensions.action.enableAllWorkspace
. You could raise a feature-request issue ticket asking for a pair of commands that take a set of extension IDs to enable/disable, similar to workbench.extensions.action.showExtensionsWithIds
.
I tried to create a janky workaround with that command but got stuck on moving tab navigation. Here's the failed/stuck attempt if you're curious:
{
"key": "ctrl+b",
"command": "runCommands",
"args": { "commands": [
{
"command": "workbench.extensions.action.showExtensionsWithIds",
"args": [["ms-vscode.makefile-tools", "twxs.cmake"]],
},
"list.focusFirst",
// how to move tab focus?
]},
},
Upvotes: 0
Reputation: 2354
To toggle Vim mode in Vscode do the following:
Use 'CTRl+Shift+P' to open vscode command palette
type 'vim toggle', you will see 'Vim: Toggle Vim Mode' option
select it and press enter to toggle vim mode.
To add keybinding (shortcut) for toggling :
Not every extension can be disabled by this method, But all extensions can be disabled or enabled for a particular workspace.
Upvotes: 10