VS Code Keybinding Generator
Generate entries for VS Code keybindings.json with key, command and when-context. Custom shortcut in seconds.
—
A VS Code keybinding with the right when clause
The VS Code keybindings file is an array of objects with three fields: the key combination, the command and, optionally, the condition under which the binding applies. The first two are obvious; the third separates a configuration that works from one that gets in the way, because without it the binding applies in every context, including inside the integrated terminal and the search box.
Fill in the fields and the page assembles the JSON ready to paste. The combination follows the editor's notation, keys joined by plus signs and chords separated by a space — two shortcuts in sequence, Emacs style. The command is the internal identifier, which you find in the command palette by turning on identifier display.
On the condition, the most useful expressions are worth knowing: the one restricting to a focused text editor, the one requiring an active selection, the one limiting to a specific language and the one testing whether the terminal has focus. They combine with the usual logical operators. To remove a default binding rather than override it, declare the same command with a minus sign in front.
Frequently asked questions
Where does the file live?
My binding does nothing. Why?
How do I find a command identifier?
Related Tools
VS Code Snippet Generator
Build a JSON snippet ready to paste into VS Code *.code-snippets files, with prefix, multi-line body and tabstops $1, $2.
VS Code tasks.json Generator
Build a VS Code tasks.json with label, type, command, group and problemMatcher. Includes configurable default shell.
HTTP Status Code Lookup
Type any HTTP status code from 100 to 511 and read its official reason phrase, across the informational, success, redirect, client and server error ranges.
Keycode Info
Press any key and see `event.key`, `event.code`, `keyCode`, `which` and `location`. Useful to build shortcuts, games and keyboard-aware forms. Everything in your browser.
Regex Visualizer
Paste a regex and see the token tree (literals, classes, groups, quantifiers) in ASCII — helps understand complex expressions. Everything in your browser.
Hexdump
View any text as a canonical hexdump (offset / hex bytes / ASCII), like Unix `hexdump -C`. Useful to inspect binary data, encoding and invisible separators. Everything in your browser.