48

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

Luiscencio
  • 3,855
  • 13
  • 43
  • 74

5 Answers5

74

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
  • 36,800
  • 16
  • 93
  • 123
  • 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
  • 3,044
  • 1
  • 23
  • 30
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
  • 54,987
  • 21
  • 291
  • 190
Agent_9191
  • 7,216
  • 5
  • 33
  • 57
5

right click -> Outlining -> Collapse To Definitions

Mah
  • 59
  • 1
  • 2
2
CTRL + M, CTRL + L

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

Steve Guidi
  • 19,700
  • 9
  • 74
  • 90