Reputation: 1247
Ctrl+M+O works really great to collapse all methods in a class however I have a hard time finding a way to collapse all classes outlining in the whole file.
One may ask - why do you have many classes in one file ? It's because I'm using MSpec and classes are my tests so I have files with tens of classes. In order to wrap my head around what is going on I often have to collapse classes one by one but that is not really efficient.
Upvotes: 58
Views: 24750
Reputation: 529
Actually, I found it more convenient to use CtrlM, CtrlM and specify the range:
This will toggle just like CtrlM,CtrlL but you decide the range!
It comes in handy to collapse multiple object initializers within a single method / everything before and after the working area. Also to expand a few relevant full-property / region / function / foreach.
Upvotes: 2
Reputation: 11054
The accepted answer is the roundabout way of doing it.
You're looking for Ctrl + M, A, which collapses all.
As Jay mentioned, Ctrl + M, L expands all, but collapses all if already expanded.
Upvotes: 33
Reputation: 57919
Ha -- well, apparently I just needed to offer a bounty before I would discover an answer minutes later.
CtrlM, CtrlL will toggle all outlining. If anything in the file is collapsed, the first time you invoke this will expand everything and then invoking it again will collapse everything. This also collapses the namespace, which is a small inconvenience, but I'll call it progress.
Upvotes: 91