21

I couldn't find a way to collapse/expand regions and sections from Visual Studio for Mac.

If someone could share how to do that, it would be very useful.

Jzrzmy
  • 301
  • 1
  • 2
  • 10

3 Answers3

39

You need to go to Preferences >> Text Editor >> General as on the image below and you will see Code Folding area.

Visual Studio for Mac Code Folding area

You can check whatever you need and you will see code folding blocks in your code.

Denis Gordin
  • 892
  • 10
  • 22
  • 6
    on regular VS i used to "CTRL+M+O" to collapse all... is there a bind on VS for mac? – Leonardo Feb 07 '19 at 17:57
  • on mine (VS for Mac 8.8.10) it is shift + option + command + [. That toggles all collapse it isn't exactly the same as it is in VS on Windows. – Sean Mar 02 '21 at 21:20
12

For VS for Mac, Menu > Edit > Outlining...

Click a menu selection.

Note - Your cursor has to be clicked inside a code file before you nav to menu item or they will be grayed out.

screenshot

Katherine
  • 3,318
  • 1
  • 13
  • 17
Zevi L.
  • 131
  • 2
  • 4
10

Yes.. You can follow this key patterns to collapse and expand all the methods.

Shift + Option + Command + ArrowDown
  • Shift + + +

OR Follow the Image Screenshot:

enter image description here

Sayed Muhammad Idrees
  • 1,245
  • 15
  • 25