Does Visual Studio Code have a keyword?

The Atom editor has a command attached to 'ctrl-.' which is called a recognition key:

enter image description here

As soon as you activate the key-resolver mode, any key that you subsequently press will tell you which commands are attached to it in all possible contexts and show which command / context wins. Then you turn off the mode by pressing ctrl-g.

This is useful when you want to know if key binding is free, or if key key binding does not do what you expect.

Here is an example output when I press ctrl-n in the editor context, where I see that the emacs keybinding "next-line" keyword takes precedence:

enter image description here

Emacs also has a similar function with the ctrl-h k (help keys) command.

Yes, I can usually get the information I need by looking at the default shortcut keys and keybindings.json, but it can be difficult to do if the key is bound in many different contexts.

Is there a function like this in VSCode?

+8
visual-studio-code
source share
1 answer

Unfortunately, no, and as far as I know, currently this cannot be done using the extension APIs. You can add feature request for this at visualstudio.uservoice.com .

Visual Studio code evaluates key bindings as follows:

  • rules are ranked from bottom to top.
  • the first rule, which coincides, both the key and in terms of time, is adopted.
  • more rules are not processed.
  • If the rule is found and has a set of commands, the command is executed.

Additional User/keybindings.json are added at runtime to the bottom of the default rules, allowing them to overwrite the default rules.

Now you can check what is associated with a specific key using Quick Outline Settings: Open shortcuts to keys . To open this view, press + + P on Mac or Ctrl + Shift + P on Windows and Linux and find this option.

enter image description here

Looking at the pace of development, this may be feasible as an extension or included in vscode in the coming months.

+6
source share

All Articles