Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collapse html in Visual Studio 2012

in previous versions of Visual Studio, you could collapse the html blocks, but that appears to be missing in VS2012. Any ideas on how to enable that feature again?

like image 444
dariwe Avatar asked Sep 24 '12 23:09

dariwe


People also ask

How do I minimize a block of code in Visual Studio?

The #Region directive enables you to collapse and hide sections of code in Visual Basic files. The #Region directive lets you specify a block of code that you can expand or collapse when using the Visual Studio code editor. The ability to hide code selectively makes your files more manageable and easier to read.

How do you fold in Visual Studio?

CTRL + M + O will collapse all.

How do you collapse code in Visual code?

Ctrl + Shift + [ on Windows and Linux. ⌥ + ⌘ + [ on macOS.


2 Answers

I was having this issue too and it was driving me nuts. Turns out that, somehow, I turned off "Automatic outlining" which meant that I did see the plus/minus signs and the shortcut Ctrl + M + M didn't work either.

After I turned on Automatic Outlining in Edit > Outlining > Start Automatic Outlining everything went back to normal.

NOTE: On some ocassions, for this solution to work, you also need to close and reopen the document before clicking on Start Automatic Outlining. In fact, sometimes that option doesn't appear in the menu if you don't do so.

like image 59
AJ Tatum Avatar answered Oct 02 '22 13:10

AJ Tatum


It's still there. The issue is that sometimes it takes a while for the parser to visually enable collapsing.

Imgur

Try Ctrl + M + M and you'll see the effect

like image 20
ciriarte Avatar answered Oct 02 '22 13:10

ciriarte