How to change keyboard shortcut bindings in VSCode

Keyboard shortcuts in Visual Studio Code allow you to perform actions quickly, without navigating through menus or using a mouse. These shortcuts can be customized to suit your workflow and preferences.

Before you modify your keybindings, it’s always a good idea to back them up. And be aware that any changes you make may conflict with other keybindings.

You can change keyboard shortcuts in Visual Studio Code in the following ways:

Command Palette

Open the Keyboard Shortcuts editor by pressing Ctrl+Shift+P (or Cmd+Shift+P on macOS) in Photoshop. This will show you all of the shortcuts for commands, and let you change them to what you prefer. Here is the popup which will open on pressing Ctrl+Shift+P (or Cmd+Shift+P on macOS)

Popup which will open on pressing Ctrl+Shift+P (or Cmd+Shift+P on macOS)
Popup which will open on pressing Ctrl+Shift+P (or Cmd+Shift+P on macOS)

Here is the screenshot for the Keyboard Shortcuts window on clicking Open Keyboard Shortcuts option:

Keyboard Shortcuts window
Keyboard Shortcuts window

You can also customize the keybindings by editing the keybindings.json file. To find this file, go to the Code menu, choose Settings, and then Keyboard Shortcuts. Here is the screenshot showing the same

Keyboard Shortcuts via Settings menu
Keyboard Shortcuts via Settings menu

Settings editor

The settings.json file in Visual Studio Code contains various settings and preferences for the editor, including keyboard shortcuts. These settings are stored in a JSON format, which stands for JavaScript Object Notation, and are used for storing and exchanging data.

You can customize keyboard shortcuts to fit your personal preferences. Open the Settings editor by pressing Ctrl+Comma (or Cmd+Comma on macOS). Then, in the search bar type “keyboard shortcuts” and select Edit in settings.json from the options. This will open the settings.json file, where you can view and change existing shortcuts.

Here is the window which will open on clicking Ctrl+Comma (or Cmd+Comma on macOS).

Settings
Settings

Click the Open Settings menu to open the settings.json file. Here is the screenshot showing the menu which you should click to open the settings:

Settings menu
Settings menu

You can search for a specific command or action by typing in the search bar at the top of the Keyboard Shortcuts editor. You can also change the keybinding for any action by clicking on it and then typing in a new keybinding. Here is an example of one such setting for changing the Keyboard shortcut.

Keyboard shortcut in settings
Keyboard shortcut in settings

Changing the setting will add a setting in the settings.json file like this:

“git-graph.keyboardShortcut.refresh”: “CTRL/CMD + G”