Reputation: 20496
How can I add multiple keyboard shortcuts to a single command in VS Code?
As an example (from the comments), ctrl
+ 0
& ctrl
+ 1
should both do the same command/action. So completely separate shortcuts doing the same command.
Upvotes: 6
Views: 1689
Reputation: 37029
Let's say there are 2 bindings to close window like so:
Let's say we want to add one more keybinding like CMD+K, CMD+1. You could do that by right-clicking a command and choosing copy like so:
Then, click on an icon on the top right corner to open keyboard shortcuts JSON. The icon has an curved arrow on a page:
Your user-defined keybindings.JSON will show up. Type this in it:
// Place your key bindings in this file to override the defaults
[
{
"key": "cmd+k cmd+1",
"command": "workbench.action.closeWindow"
}
]
Save and close.
Now you will see 3 keybindings for the action like so:
Now, try your new keybinding.
Upvotes: 7