William Entriken
William Entriken

Reputation: 39253

How to find VS Code keyboard shortcut conflict?

I use Command-Shift-F (default setting) for global find all. Extensively.

When I am editing a Java file, in addition to the problem that Java is on my screen, this shortcut doesn't work. Instead, Command-Shift-F will fold code in the current bracket to use less vertical whitespace.

I have never changed a default keyboard setting. As confirmed by Preferences > Keyboard Shortcuts and reviewing the right column.

How can I find which thing has commandeered my normal finding experience?

Upvotes: 1

Views: 2007

Answers (3)

myf
myf

Reputation: 11283

  1. Open File > Preferences > Keyboard Shortcuts (CtrlK CtrlS key chord on Windows).
  2. Invoke Record Keys command ( button toggle or AltK): Keyboard shortcuts settings input field showing activated button with keyboard icon, "Record keys (Alt+K)" tooltip nearby and "Recording keys" info bubble in the end of the input on the left.,
  3. With focus inside the search field, press the keyboard shortcut or chord you need to find command bindings for.
  4. Observe its When condition; eventually remove or change it through the Change When Expression context menu entry (or CtrlK CtrlE) on active Command in the filtered list: "Change When Expression" is the penultimate item in the context menu.

Official documentaion: https://code.visualstudio.com/docs/getstarted/keybindings

Upvotes: 4

lacostenycoder
lacostenycoder

Reputation: 11216

Here's and example walk through how to solve a conflict:

I was having a problem with using system default Ctrl+N to open a new tab when already on a tab while in vim mode. So to find the conflicts I did:

File > Preferences > Keyboard Shortcuts

Then from here you click on the keyboard icon to the right to enter record keystroke mode and type combination you're looking for.

This showed me system and vim extension conflict. Since I never really want to use Shift+Ctrl+N to open a full new window, I was able to swap the system for that to Shift+Alt+N by clicking on the edit button on the left when you select it.

Then I was able to change system default to Shift+Ctrl+N to open new tab. Now it works both in vim mode and as system default no conflicts.

Upvotes: 1

Mark
Mark

Reputation: 181030

There is a command Developer: Toggle Keyboard Shortcuts Troubleshooting

toggle that on and then hit Cmd+Shift+F

in the Output you should get something like this:

[2021-02-23 20:18:46.228] [renderer2] [info] [KeybindingService]: | Resolving ctrl+shift+J [2021-02-23 20:18:46.229] [renderer2] [info] [KeybindingService]:
From 2 keybinding entries, matched extension.convertCSSinJS, when: editorTextFocus, source: user extension paulmolluzzo.convert-css-in-js.

You can see that vscode is telling me that it resolved Ctrl+Shift+J to a certain command extension.convertCSSinJS coming from the extension paulmolluzzo.convert-css-in-js which is the publisherName.name. I don't have any extension named exactly that (beause an extension's displayName is probably rarely the same as its name - which can't have spaces) but you should be able to figure out which extension is the culprit from that info.

Upvotes: 1

Related Questions