Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collapse ALL #region in Visual Studio 2012

Tags:

First of all, no CTRL+M, CTRL+O is not the answer. For me, this is collapsing #Region, ///Comments, and Methods and I hate that.

I'd like to collapse/expand ONLY #region sections. I am using Visual Studio 2012 and Resharper.

like image 828
poudigne Avatar asked Apr 10 '13 19:04

poudigne


People also ask

How do you collapse all or code?

How to Collapse All Source Code in VS Code? To fold all top-level and child elements of your code: Enter command >fold and hit enter.

How do I collapse all in a pivot table?

Right-click the item, click Expand/Collapse, and then do one of the following: To see the details for the current item, click Expand. To hide the details for the current item, click Collapse. To hide the details for all items in a field, click Collapse Entire Field.


2 Answers

ctrl+m, ctrl+s will collapse the current region. You can select multiple regions manually and collapse them that way.

Since the command "Collapse all open region" doesn't exist, you could always try to create a new one; In that case, check out this post: How to add commands to Visual Studio 2012?

like image 192
Felix Avatar answered Oct 06 '22 05:10

Felix


You can't collapse just regions, but the shortcut key chord: ctrl+m, ctrl+l will do it for everything.

like image 45
Vahid Mehrabi Avatar answered Oct 06 '22 06:10

Vahid Mehrabi