Collapse html in Visual Studio 2012
Asked Answered
H

6

46

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?

Horthy answered 24/9, 2012 at 23:38 Comment(2)
#1730341 no a duplicate but related on how to colapse a whole document ctrl+M+O;Aeolis
One thing I noticed is that outlining can be broken by anything that's not strict XHTML. So if you have a meta or br element that is not self closing, the parser will continue to look through the rest of the document for the closing tag. Weary from searching, it will give up and refuse to outline anything.Foreland
B
102

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.

Bicyclic answered 28/9, 2012 at 17:39 Comment(3)
That is very wired. I had to switch ON the automatic outlining, in order to get the element collapsing to work. I will still upvote this answer because it did help me somehow.Ladonnalady
Same as @Ladonnalady - I had to switch ON outlining.Tranquillity
ditto. had to turn it off.Admirable
S
11

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

Saeger answered 24/9, 2012 at 23:47 Comment(0)
F
3

I prefer using Ctrl + M + H whenever I want to hide unwanted code irrespective of any tree hierarchy. This works great even if I want to hide my commented code.

You just need to select the code that you want to collaspe and hit Ctrl + M + H and its hidden now :)

enter image description here

Flyn answered 16/5, 2015 at 18:25 Comment(0)
R
2

When you open the font .cshtml, you will have go to EDIT->Outlining->Start Automatic Outlining

Ratchford answered 6/3, 2014 at 13:57 Comment(0)
F
0

Just hover your mouse on code editor and wait a moment, don't move your mouse :)

The outline tree will show out.

before and after

False answered 13/11, 2014 at 8:52 Comment(3)
hey what is your font name buddy i like itGernhard
@BurakOgutken haha! the font's merged by myself, uses Glass_TTY_VT220 and msyh and some style adjust, you can get it from drive.google.com/open?id=0BydI37B8JmUeUmVNaTJJV2FzN00False
Sorry i am first time to using google driver, the file was set to share :)False
R
0

right click on html, cshtml or aspx file in solution explorer and select open with option:
in dialog select html editor and click on set as defualt button.
open html or cshtml or aspx file and enjoy html file with outline html tag. :)

Repellent answered 27/5, 2016 at 5:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.