Wednesday, March 11, 2020

Visual Studio Expand/Collapse keyboard shortcuts

Ctrl+M,O would collapse all constructors, methods, properties in a file. It would also collapse all regions.

Ctrl+M,L would expand all constructors, methods, properties in a file. It would also expand all regions.



Visual studio 2017 except it is turned off by default. It can be enabled under Tools -> Options -> Text Editor -> C# -> Advanced -> Outlining -> "Collapse #regions when collapsing to definitions"



Visual Studio 2015:

Tools > Options > Settings > Environment > Keyboard
Defaults:

Edit.CollapsetoDefinitions: CTRL + M + O

Edit.CollapseCurrentRegion: CTRL + M +CTRL + S

Edit.ExpandAllOutlining: CTRL + M + CTRL + X

Edit.ExpandCurrentRegion: CTRL + M + CTRL + E

To set and use IntelliJ's shortcuts:

Edit.CollapsetoDefinitions: CTRL + SHIFT + NUM-

Edit.CollapseCurrentRegion: CTRL + NUM-

Edit.ExpandAllOutlining: CTRL + SHIFT + NUM+

Edit.ExpandCurrentRegion: CTRL + NUM+


Collapse to definitions
CTRL + MO
Expand all outlining
CTRL + MX
Expand or collapse everything
CTRL + ML

No comments:

Post a Comment

Mixed Content: The page at xxx was loaded over HTTPS, but requested an insecure

 Mixed Content: The page at ' https ://www.test.com/signup.aspx' was loaded over HTTPS, but requested an insecure script ' http ...