To manage your keyboard shortcuts in VSCode, hold down cmd
+ shift
+ p
to open the command palette and search for keyboard shortcuts
then choose the option Preferences: Open Keyboard Shortcuts.
![](https://s3.amazonaws.com/making-the-internet/cws-vscode-keyboard-shortcuts-command@2x.png)
In the interface that appears you can search for any command within VSCode by name. Alternatively, if you click the keyboard icon in the search bar you can search by a key combination.
![](https://s3.amazonaws.com/making-the-internet/cws-vscode-search-key-commands@2x.png)
Editing shortcuts
Once you locate the command/shortcut you wish to edit, double click it and it will prompt you to enter the key combination (aka keybinding) you want to assign to that command.
![](https://s3.amazonaws.com/making-the-internet/cws-vscode-edit-keybinding@2x.png)
If the key combination you enter is already being used by another command, it will let you know. When this happens, you will either have to choose a different key combination or change/remove the other command that is already using that key combination.
To remove a keybinding from a command, right click the command and choose Remove keybinding.
![](https://s3.amazonaws.com/making-the-internet/cws-vscode-remove-keybinding@2x.png)
Context in which the shortcut will work
For each command, there’s a When clause that specifies the context of when that keybinding would apply. Here’s a list of all the available contexts.... To edit the When clause, right click the command and choose Change When Expression.
![](https://s3.amazonaws.com/making-the-internet/cws-vscode-when-context@2x.png)
keybindings.json
All of your keybinding customizations are stored in a JSON file located at ~/Library/Application\ Support/Code/User/keybindings.json
.
To quickly open this file hold down cmd
+ shift
+ p
to open the command palette and search for keyboard shortcuts
then choose the option Preferences: Open Keyboard Shortcuts (JSON).
If you have not yet made any customizations, the JSON object within this file will be empty:
// Place your key bindings in this file to override the defaults
[
]
Once you make customizations, they’ll be added to this file following the format shown in this example:
[
{
"key": "cmd+k",
"command": "md-shortcut.toggleLink",
"when": "editorTextFocus && markdownShortcuts:enabled"
}
]
Each command should include a value for key, command, and optionally when. To find out the specific name for a command you can refer to the keybindings interface described above.
To disable a default command, prefix the command with a negative sign (-
). Example:
{
"key": "cmd+=",
"command": "-workbench.action.zoomIn" // Removes the default shortcut of zooming in interface with cmd +
},