Is it anyway possible to open all files which found in my search query? Otherwise I need to double click 37 times for a single search result which seems suboptimal.
Example of search
As stated in @Alex's comment, search.action.focusNextSearchResult
is a great match for @NealVDV's use case. It can be run by pressing F4
. It will open each result one after the other in a (writable) preview tab.
F4
(search.action.focusNextSearchResult
) cycles forward through the search resultsShift+F4
(search.action.focusPreviousSearchResult
) cycles backward through the search results@jakub.g makes the remark that modifying a file in a way that removes them from the search result will make the focusNextSearchResult
pointer restart from the beginning. A solution to this issue is to make sure that either:
There is this VS Code extension for that: Search - Open All Results
To install it, launch VS Code Quick Open (Ctrl+P) and run
ext install fabiospampinato.vscode-search-open-all-results
search.action.focusNextSearchResult
…
Nov 13, 2020 at 6:51
CTRL+P
and type: >Open All Results
, it will loop over the first ~10 hits only. So I tried: "searchOpenAllResults.fileResultsLimit": 300,
and re-loading the VScode. That did not change the behaviour. Do you know how to make it open all results instead?
Turns out you can shift + click to highlight all the results, and then you drag them over same as any other file. In vscode 1.71.2, at least.
I had 150 to open. Phew.
I'm not sure how to do this with a VSCode native tool, but you could do this using VSCode terminal to find the pattern that you're looking for and open all files that match your search pattern. Something like the following:
grep -l "<Icon" * | xargs code
xargs
to pass the output as the argument for code
.This way you won't have to double click all the files one-by-one.
You can use the up/down arrow keys to highlight the file in the search results. Then press the right arrow and it will open the file without closing the search results. So you basically have to press down arrow, right arrow 37 times instead of clicking. Not great, but still faster.
"workbench.editor.enablePreview": false
position="left" anotherProp="somevalue"
and they are not in the same order or it depends on the otherprop. So a simple replace won't worksearch.action.focusNextSearchResult
F4 keybindingF4
seems interesting, but if you need to change some of the files in a way that makes them disappear from search results, the pointer is reset andF4
starts the cycle again from the beginning.