Shortcut key to jump to "files to include" input in Find In Files

421 Views Asked by At

I use the keyboard shortcut for Find in Files (CtrlShift+F), and use other hotkeys, like Alt+R to toggle regex matching on/off (though I wish they'd used the same shortcuts as Visual Studio!

In Visual Studio you can jump to the File Types input with Alt+T, but I can't figure out a way to do it in VS Code, I have to resort to pressing Tab 5 times. Anyone know the keyboard shortcut to jump directly to that input?

3

There are 3 best solutions below

3
On BEST ANSWER

New answer: Up/down arrows now navigate the history of each search field. You can use cmd+up/down to switch between the inputs.

Original answer: You can use the up/down arrows to switch between these inputs.

0
On

VSCode 1.70 (July 2022) adds a related feature:

Search Editor: Allow Keyboard Shortcut for File to Include/Exclude

In the search editor, there is search.action.focusQueryEditorWidget to focus on the query.
I'd like to be able to set a keyboard shortcut to focus on "files to include" and "files to exclude".

Fixed with PR 153954

This adds keybindings to quickly focus on files to include/exclude.

I tried to follow the pattern for the toggle X keybindings, so I went with:

  • Cmd+Alt+F and
  • Cmd+Alt+Shift+F.

I used "F" for "files".

This is available in VSCode insiders today.

1
On

After inspecting context keys as suggested in the @VonC's answer, I found a searchInputBoxFocus context key. Reverse search among all keybindings reveals that after pressing Ctrl+Shift+F to open search, you can press Ctrl+Down to switch to the next input - the "files to include" - without five Tabs.