A2oz

What is the shortcut for collapse folders in Explorer VS Code?

Published in VS Code 1 min read

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) or Cmd+Shift+P (macOS) to open the command palette and type Explorer: Expand All.
  • Collapse all folders: Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the command palette and type Explorer: Collapse All.

These commands allow you to quickly control the visibility of folders in the Explorer view.

Related Articles