Luiscencio
Luiscencio

Reputation: 3965

How can I collapse all #regions and methods in c#?

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

Upvotes: 52

Views: 54265

Answers (5)

Agent_9191
Agent_9191

Reputation: 7253

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

Upvotes: 9

Sina Lotfi
Sina Lotfi

Reputation: 3284

  • Collapsing and Openning recursively: Ctrl+M+L

  • Just Collapsing: Ctrl+M+O

  • Just Openning: Ctrl+M+P

Upvotes: 15

Mah
Mah

Reputation: 59

right click -> Outlining -> Collapse To Definitions

Upvotes: 5

Jorge Israel Peña
Jorge Israel Peña

Reputation: 38626

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

Upvotes: 78

Steve Guidi
Steve Guidi

Reputation: 20198

CTRL + M, CTRL + L

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

Upvotes: 3

Related Questions