Viewing Current Keybindings
There are several ways to view and manage your keyboard shortcuts:Open Keyboard Shortcuts Editor
Use
Ctrl+K Ctrl+S (Windows/Linux) or Cmd+K Cmd+S (macOS) to open the Keyboard Shortcuts editor.This provides a searchable UI for viewing and editing keybindings.Search for Commands
Type in the search box to filter by:
- Command name (e.g., “copy”)
- Keybinding (e.g., “ctrl+c”)
- Source (e.g., “@source:user” or “@source:default”)
Keybindings JSON Format
For advanced customization, you can edit thekeybindings.json file directly:
- Open the Command Palette (
Ctrl+Shift+PorCmd+Shift+P) - Type “Preferences: Open Keyboard Shortcuts (JSON)“
File Location
- Windows:
%APPDATA%\Code\User\keybindings.json - macOS:
~/Library/Application Support/Code/User/keybindings.json - Linux:
~/.config/Code/User/keybindings.json
Keybinding Structure
Each keybinding entry has the following structure:keybindings.json
With Conditions (When Clauses)
You can make keybindings context-sensitive usingwhen clauses:
keybindings.json
With Arguments
Some commands accept arguments:keybindings.json
Removing Default Keybindings
To remove a default keybinding, use the minus sign before the command:keybindings.json
Removing a keybinding doesn’t delete it permanently from VS Code—it just prevents it from triggering. You can always restore default keybindings from the Keyboard Shortcuts editor.
Common Keybinding Examples
Here are practical examples of custom keybindings:Editor Commands
keybindings.json
File Navigation
keybindings.json
Terminal Commands
keybindings.json
Search and Replace
keybindings.json
Chord Keybindings
VS Code supports multi-key sequences (chords):keybindings.json
When Clause Contexts
Common context keys forwhen clauses:
editorTextFocus- Editor has focuseditorReadonly- Editor is read-onlyeditorHasSelection- Text is selectedinQuickOpen- Quick Open is visibleterminalFocus- Terminal has focussideBarVisible- Side bar is visibleexplorerViewletVisible- Explorer is visible
Combining Conditions
keybindings.json
Platform-Specific Keybindings
You can define different keybindings for different platforms in your extensions or using conditional logic. The key format differs:- Windows/Linux:
ctrl,shift,alt - macOS:
cmd,shift,alt(oroption),ctrl
Searching Keybindings
You can search keybindings using special filters in the Keyboard Shortcuts editor:@command:commandId- Find keybindings for a specific command@source:user- Show only user-defined keybindings@source:default- Show only default keybindings@source:extension- Show extension keybindings
Troubleshooting
Viewing Keybinding Conflicts
In the Keyboard Shortcuts editor, VS Code will show a warning icon next to conflicting keybindings. Click on it to see what other commands use the same shortcut.Advanced: JSON Schema
Thekeybindings.json file is validated against a JSON schema that includes:
key: Key or key sequence (required)command: Command identifier (required)when: Condition for when the keybinding is active (optional)args: Arguments to pass to the command (optional)
Next Steps
Settings
Configure editor behavior
Snippets
Create code snippets