How to Configure Keybindings in VS Code

· Category: VS Code & Developer Tools

Short answer

VS Code allows you to customize keyboard shortcuts through the Keybindings editor. You can search for commands, assign new keys, and remove defaults to match your workflow.

Steps

  1. Open the Keybindings editor with Ctrl+K Ctrl+S (or Cmd+K Cmd+S on macOS).
  2. Search for the command you want to bind.
  3. Right-click and select "Add Keybinding" or click the plus icon.
  4. Press the desired key combination and press Enter to confirm.
  5. To remove a binding, right-click it and select "Remove Keybinding".

Tips

  • You can open the keybindings.json file directly for advanced customizations like chords.
  • Use the "when" clause context to make bindings conditional on the file type.
  • Export your keybindings to sync them across machines.

Common issues

  • Conflicting keybindings are highlighted in orange; resolve them by reassigning one.
  • Some OS-level shortcuts intercept keys before VS Code receives them.