Is there any way to navigate the search editor (whole workspace search) using only cursor keys in vscode ? I'm talking about the whole workspace search and not just the find/replace search.

- 9,612
- 5
- 44
- 79

- 1,643
- 1
- 10
- 20
-
Can you include a picture or some sort of visual descriptor because vscode has multiple search ‘editors’. Either way you should be above to navigate tabbing through the elements, or forcing tab trapping mode https://code.visualstudio.com/docs/editor/accessibility#_tab-navigation – soulshined Jul 26 '20 at 22:30
-
included an image. – pandith padaya Jul 26 '20 at 22:43
-
Please mark my answer accepted if it helped pandith, otherwise let me know where I can improve – soulshined Jul 28 '20 at 16:22
-
For reference: Search Editor [docs](https://code.visualstudio.com/docs/editor/codebasics#_search-editor) ([snap](https://archive.ph/rBE0b#_search-editor) [shots](https://web.archive.org/web/20230308202759/https://code.visualstudio.com/docs/editor/codebasics#_search-editor)) and release notes of [v1.43](https://code.visualstudio.com/updates/v1_43) from February 2020. – cachius Mar 10 '23 at 11:18
1 Answers
The new search editor thankfully has ported over most of the shortcut commands you have grown to know, but for brevity, this answer will include only the default keybinds with respective command id.
The when
expression most commonly associated with these keybinds, should you want to alter them, are :
inSearchEditor
hasSearchResult
searchInputBoxFocus
Searching
Context Lines
- Toggle context lines :
toggleSearchEditorContextLines
ALT + LWill show n lines before or after search result, for context
- Reduce context line quantity :
decreaseSearchEditorContextLines
ALT + - - Increase context line quantity :
increaseSearchEditorContextLines
ALT + =
Query Details
- Toggle Query Details :
workbench.action.search.toggleQueryDetails
This will toggle the include/exclude file input boxes
Settings
- Toggle Match Case :
toggleSearchCaseSensitive
ALT + C - Toggle Regex :
toggleSearchEditorRegex
ALT + R - Toggle Word Match :
toggleSearchEditorWholeWord
ALT + W
Navigation
Luckily, because the search editor is effectively an 'editor', you can continue to use all the keybinds that you are used to. So, in order to jump straight to the editor, you can use whatever your keybind is to jump to an editor group, default is: CTRL + 1 (commandId: workbench.action.focusFirstEditorGroup
)
Navigating matches
- Go to next match :
search.action.focusNextSearchResult
F4 - Go to previous match :
search.action.focusPreviousSearchResult
SHIFT + F4 - Select all matches :
selectAllSearchEditorMatches
CTRL + SHIFT + L
Results
Deleting result block :
workbench.action.searchEditor.deleteResultBlock
CTRL + SHIFT + BACKSPACEThis deletes a block of results from the editor
For example, in the picture below, if my cursor is anywhere in the 'convert.js' result block the entire convert.js matches would be removed. You can undo this with CTRL + Z
Go To Definition (effectively go to file)
- You can peek with ALT + F12 when your cursor is anywhere on the file name
- You can assign a keyboard shortcut to follow links for the commandId:
editor.action.openLink
for when your cursor is on the file name - You can go directly to the file & line number of the search result using F12 while your cursor is anywhere on that result
Navigate Back to Input Box
- Focus Search Input Box From Results:
search.action.focusQueryEditorWidget
ESCAPE
Searching within Search Editor
As noted, the search editor is effectively an editor, so you can resume using CTRL + F (find) or CTRL + H (find/replace) to narrow down results even more, and the keybinds set for those are maintained as used elsewhere.
Miscellaneous
- Search again:
rerunSearchEditorSearch
CTRL + SHIFT + RPerhaps you deleted too many result blocks
Otherwise, while your cursor is actively in the editor (results), you have the freedom to use most of your keybinds per normal, including collapsing/folding, jumping, copying, moving to editor groups etc

- 9,612
- 5
- 44
- 79
-
1With VSCode 1.51: https://github.com/microsoft/vscode/issues/107208, one more shortcut. – VonC Oct 11 '20 at 12:06