47

it is very annoying to collapse all one by one...

Luiscencio
  • 3,775
  • 13
  • 42
  • 74

5 Answers5

73

Like Steve said, CTRL + M plus CTRL + L for collapsing all regions recursively. This one is a toggle, meaning you can do it again to re-open them.

Do CTRL + M plus CTRL + O to collapse all regions non-recursively.

Source: http://weblogs.asp.net/mrdave/archive/2004/09/17/230732.aspx

Jorge Israel Peña
  • 34,719
  • 16
  • 88
  • 119
  • Ctrl+M,Ctrl+O does collapse the comments and methods inside the regions as well, just nothing on a higher level (like the class or namespace itself). Not what I wanted. – ygoe Jun 03 '15 at 12:44
  • 1
    what do you mean by recursive and non-recursive collapsing? do you mean nested regions will get collapsed if its recursive? – M.kazem Akhgary Feb 06 '18 at 09:07
12
  • Collapsing and Openning recursively: Ctrl+M+L

  • Just Collapsing: Ctrl+M+O

  • Just Openning: Ctrl+M+P

Community
  • 1
  • 1
Sina Lotfi
  • 2,615
  • 1
  • 20
  • 27
8

Quickest way will be to collapse to definitions via Ctrl+M, Ctrl+O. That will collapse all code down to the signature lines.

Xavier Guihot
  • 43,847
  • 17
  • 251
  • 159
Agent_9191
  • 7,106
  • 5
  • 31
  • 57
4

right click -> Outlining -> Collapse To Definitions

Mah
  • 49
  • 2
2
CTRL + M, CTRL + L

This will also collapse anything that is collapsible too, such as scopes defined by braces.

Steve Guidi
  • 19,072
  • 8
  • 70
  • 88