Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore Ctrl+M,O behaviour in VS2017

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

In VS2017 it no longer collapses the regions.

I really liked the high level view that this keyboard chord produced, with collapsed regions. In VS2017 that chord will actually expand all regions too.

You can invoke Ctrl+M,L twice, but this collapses everything which makes it impossible to see anything.

Is there a way of getting the old behaviour back?

like image 708
Drew Noakes Avatar asked Mar 23 '17 20:03

Drew Noakes


People also ask

How do I undo Ctrl KC?

To comment code: Press Ctrl+K, then also press C while still holding the Ctrl key. To uncomment code: Press Ctrl+K, then also press U while still holding the Ctrl key. You can release the Ctrl key after pressing K, then press Ctrl+C (or Ctrl+U to uncomment), but is just easier to press the keys in succession.

How do I change the shortcut keys in Visual Studio?

Customize a keyboard shortcutOn the menu bar, choose Tools > Options. Expand Environment, and then choose Keyboard.

What is Ctrl KD in Visual Studio?

Ctrl + K + D (Entire document) Ctrl + K + F (Selection only) To find out which key bindings apply in YOUR copy of Visual Studio, look in the Edit > Advanced menu - the keys are displayed to the right of the menu items, so it's easy to discover what they are on your system.

How do I expand all functions in Visual Studio?

CTRL + M + P will expand all and disable outlining. CTRL + M + M will collapse/expand the current section.


1 Answers

Seems like there's a solution for it here If I understood you right

It seems that this behavior still exists within 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"

enter image description here

like image 151
Gal Ben Arieh Avatar answered Oct 31 '22 18:10

Gal Ben Arieh