Cm, Co // collapse all Cm, Cl // expand all Cm, Cm // collapse, expand one
Where C is not suitable for Ctrl . You can find additional shortcuts on msdn website
You can find the commands by going to the "Keyboard Settings" in the "Tools" menu, they are displayed in these commands
- Edit .CollapseToDefinitions (
Cm, Co ), - Edit.ToggleOutliningExpansion (
Cm, Cm ) and - Edit.ToggleAllOutlining (
Cm, Cl )

If you use Visual Studio Code, the commands are similar, but they work differently. The teams are approximately like this
Ck 2 - Fold Level 2Ck Cj - Expand AllCk [ - Expand recursively (expand where the carriage is)
You can search for Fold or Unfold commands (using CSp ) to find them all.
Patrick Nov 12 2018-10-12 13:46
source share