Nam G VU
Nam G VU

Reputation: 35434

Visual Studio 2015 C# hotkey to collapse containing region

I use lots of #region to organize my C# codes and one very-often thing I have to repeat is collapse and/or expand the #region area by clicking on the button lie at the #region containing line - i.e. the one marked with @1 as the below snapshot.

It would be lovely to be able to have a hotkey so that we can quickly collapse/expand the current region that contains the current line where the caret is in.

My google search comes up little helps so I ask here.

Is it possible and how can we archive that?

enter image description here

Upvotes: 1

Views: 79

Answers (2)

Ivan Gritsenko
Ivan Gritsenko

Reputation: 4226

With visual studio defaults you can:

  • Collapse current region ctrl+m, ctrl+s. Command Edit.CollapseCurrentRegion
  • Expand current region ctrl+m, ctrl+e. Command Edit.ExpandCurrentRegion

Try to set it up or find out your settings for these commands in Options->Environment->Keyboard

Upvotes: 2

venkat
venkat

Reputation: 259

Ctrl+M, Ctrl+S is used to expand or collapse the current region

from MSD

Upvotes: 3

Related Questions