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

3

7

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?

Griff answered 30/8, 2017 at 20:22 Comment(1)
I see you can change the toggleFindRegex shortcut, I'm a little happier :)Griff
V
12

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.

Vatic answered 31/8, 2017 at 3:29 Comment(3)
Wow I'm embarrassed I didn't try that :| Thanks @Rob!Griff
This is no longer working for me, perhaps they changed it in a recent release of Code? However CTRL+TAB worksGriff
And if it's not on use, just check the workbench.action.search.toggleQueryDetails keyboard shortcut.Syntactics
B
1

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.

Bing answered 28/7, 2022 at 12:24 Comment(0)
F
1

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.

Feria answered 22/9, 2023 at 8:51 Comment(1)
Good catch. Upvoted.Bing

© 2022 - 2024 — McMap. All rights reserved.