Unfortunately, there is no dedicated shortcut to collapse all folders in the Explorer view within VS Code. However, you can use the following keyboard shortcuts to achieve the desired result:
- Expand all folders:
Ctrl+Shift+P
(Windows/Linux) orCmd+Shift+P
(macOS) to open the command palette and typeExplorer: Expand All
. - Collapse all folders:
Ctrl+Shift+P
(Windows/Linux) orCmd+Shift+P
(macOS) to open the command palette and typeExplorer: Collapse All
.
These commands allow you to quickly control the visibility of folders in the Explorer view.