In VS Code file searching, can I expand all results?

See this setting:

search.collapseResults: alwaysExpand

The options are auto,alwaysCollapse, and alwaysExpand. auto is the default.

auto: Files with less than 10 results are expanded. Others are collapsed.

So you want the alwaysExpand option.

You can also toggle any file expanded/collapsed with the Space key or just expand any collapsed file with RightArrow.

Collapse with LeftArrow and collapse all with Ctrl+LeftArrow. Oddly, there is no expandAll binding or command.


v1.41 is making expanded search results the default, see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_41.md#search

Expand all search results by default

Previously, if a full text search returned more than 10 results in a single file, it would appear collaped in the results tree. However, this sometimes made finding a particular result difficult, so with this release all results will appear expanded. You can set search.collapseResults to auto to revert to the old behaviour.

And see Visual Studio Code - Include context in search results for showing the search results in an editor.