Overwrite a Keyboard Shortcut in VS Code

1. Open the Keyboard Shortcuts menu

Ctrl+K Ctrl+S

This opens the full keybinding editor.

Note: we can also go to File -> Preferences -> Keyboard shortcuts

2. Search for the command we want to change

Use the search bar at the top and type the command name, for example:

Graphviz: Show Preview

or any other command we want to rebind.

3. Click the pencil icon

On the right side of the command row, click the pencil icon to edit the shortcut.

4. Press the new keybinding

VS Code enters “listening mode.”

Press the shortcut you want to assign, such as: e.g

Ctrl+Alt+G

5. Confirm the overwrite

If the shortcut is already used, VS Code will show a conflict message.

Click Yes to overwrite the existing keybinding.

6. (Optional) Edit the JSON directly

If you prefer manual control:

  1. Press Ctrl+Shift+P
  2. Search: Open Keyboard Shortcuts (JSON)
  3. Add your override:

json

{
"key": "ctrl+alt+g",
"command": "graphviz.showPreview"
}

This always overrides the default.

Leave a Reply

Your email address will not be published. Required fields are marked *