The Atom editor has a command that is bound to 'ctrl-.' that is called the keybinding resolver:
Once you activate key-resolver mode, any key you subsequently press will tell you what command(s) are bound to it, in all possible contexts, and show you which command/context "wins out". You then toggle the mode off by pressing ctrl-g.
This is useful for when you want to know if a key binding is free, or if a key key binding isn't doing what you expect.
Here's an example output for when I press ctrl-n in an editor context , where I can see that the emacs keybinding 'next-line' is taking precedence:
Emacs also has a similar feature with it's ctrl-h k (help keys) command.
Yes, I can usually glean the information I need by browsing the Default Keyboard Shortcuts and keybindings.json, but this can be hard to do if a key is bound in a lot of different contexts.
Is there a feature similar to this in VSCode?
All keyboard shortcuts in VS Code can be customized via the keybindings. json file. To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and select the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar. This will open your keybindings.
Click File > Preferences > Keyboard Shortcuts. There is a triple-dot (...) at the top-right hand corner. Click on that and select "Show User Keybindings" Delete your listed keybindings.
VS Code blocks saving the file to prevent overwriting changes that have been made outside of the editor. Use the actions in the editor toolbar to resolve the save conflict. You can either Accept your changes and thereby overwriting any changes on disk, or Revert to the version on disk.
VS Code allows you to quickly search over all files in the currently opened folder. Press Ctrl+Shift+F and enter your search term. Search results are grouped into files containing the search term, with an indication of the hits in each file and its location.
Unfortunately not and as far as I know it currently can't be done using extensions API. The feature request for this feature can be found here.
Visual Studio Code evaluates keybindings as follows:
The additional User/keybindings.json
rules are appended at runtime to the bottom of the default rules, thus allowing them to overwrite the default rules.
For now you can check what is bound to a specific key using Quick Outline Preferences: Open Keyboard Shortcuts. To open this view, press ⇧+⌘+P on Mac or Ctrl+Shift+P on Windows & Linux, and look for this option.
Looking at the development pace this might be doable as extension or included in vscode in upcoming months.
Not sure when the feature was added, but now in the Keyboard Shortcuts
menu reached via Ctrl+K, Ctrl+S
, you can click the small keyboard icon in the right of the search field, or alternatively press Alt+K
, to Record Keys
vscode will capture the key command you enter and display results for it, rather than having to enter text description of the key command in correct syntax, which is almost like the keybinding resolver in atom.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With