it is very annoying to collapse all one by one...
Asked
Active
Viewed 5.1k times
5 Answers
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
-
1what 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+LJust
Collapsing
: Ctrl+M+OJust
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
-
3I like this one: CTRL+M, CTRL+L collapses a bit too much for my taste. – Fredrik Mörk Oct 14 '09 at 22:02
5
right click -> Outlining -> Collapse To Definitions

Mah
- 59
- 1
- 2
-
Unfortunately, that collapses all of the methods and documentation headers too - not what I was expecting. – NightOwl888 Oct 03 '16 at 17:24
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