Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the keyboard shortcut to collapse current region in VS2008?

By "current region" I mean a region where the cursor is.

EDIT: I am looking for region toggling, not outlining expansion toggling. By "region" I mean section of code defined by #region and #endregion directives. Ctrl + M, Ctrl + M toggles closest outlining (which for most cases would be current method not region).

like image 256
Dawid Ohia Avatar asked Feb 24 '10 16:02

Dawid Ohia


People also ask

How do you collapse a region?

To collapse an outlining region, double-click any line in the region on the outlining margin, which appears just to the left of the code. You can see the contents of a collapsed region as a tooltip when you hover over the collapsed region.

How do I collapse a region in Visual Studio?

Collapse All Regions command for #region blocks in C#, VB, C/C++, XAML (and possibly F#) source code files. The default key binding for this command is [Ctrl+M, Ctrl+R] Note: It may also work with F# files, when a #region block handler extension is installed.

How do you collapse all regions in C#?

Do CTRL + M plus CTRL + O to collapse all regions non-recursively. 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).

Which shortcut key is used to collapse current class method or namespace?

Ctrl + M , Ctrl + L toggles all foldables recursively, from the top namespace down to the inner methods and comments.


Video Answer


1 Answers

CTRL + M, M should do the trick

By the way you can download a "poster" of shortcuts here

like image 197
Josh Mein Avatar answered Sep 22 '22 15:09

Josh Mein