Home Download Buy Blog Forum Support

Folding Up in html

Folding Up in html

Postby flannel jesus on Thu Dec 20, 2012 11:33 pm

I'm a new sublime user, transferring over from notepad++. One of the things I really liked about notepad++ was that it allowed you to fold up whole sections of html based on the tags alone. I notice that you can also fold up in Sublime, but it's based on indentation (at least by default).

In case you don't know what I mean, Imagine the following html:

Code: Select all
<body>
<ul>
   <li></li>
</ul>
</body>


In notepad++, you would be able to fold up the ul and the body elements completely, regardless of the fact that the contents of body are not indented.
In sublime, by default, you would only be able to fold up the ul element because the contents are tabbed.

How can I add that notepad++ folding functionality to sublime?

[edit]
one very attractive solution is to just select everything and click ctrl+shft+p and find the 'reindent lines' command.
flannel jesus
 
Posts: 9
Joined: Thu Dec 20, 2012 10:08 pm

Re: Folding Up in html

Postby iamntz on Fri Dec 21, 2012 12:23 pm

AFAIK folding on sublime is not language specific and it's based on indent.
iamntz
 
Posts: 915
Joined: Fri Apr 29, 2011 8:52 am
Location: Romania

Re: Folding Up in html

Postby flannel jesus on Sat Dec 22, 2012 10:18 pm

maybe there's a plugin for it? I suppose it wouldn't be too bad if it were only based on indents, as I suppose best practice is to indent anyway, but still...
flannel jesus
 
Posts: 9
Joined: Thu Dec 20, 2012 10:08 pm

Re: Folding Up in html

Postby FichteFoll on Sat Dec 29, 2012 3:18 am

You can not access the indention arrows shown next to the line numbers using the API. The only way would be to fold a section using a plugin.
Maybe you can also do this with a macro since, iirc, there are a few commands which will expand the current selection to the end of the tag and then run the "fold" command. I do (unindented) HTML or XML only rarely if at all but maybe this is already enough information for you.
FichteFoll
 
Posts: 401
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Folding Up in html

Postby ArtDesire on Sat Dec 29, 2012 7:03 am

wow, it's a bug.
I've pasted a valid source of my page, and folding works verryyy unusual.
ArtDesire
 
Posts: 26
Joined: Thu Dec 27, 2012 9:41 pm
Location: Canada

Re: Folding Up in html

Postby ArtDesire on Sun Dec 30, 2012 6:17 pm

ArtDesire wrote:wow, it's a bug.
I've pasted a valid source of my page, and folding works verryyy unusual.

Found out why it's happened to me. I had wrong count of indent. but it is not right that Sublime folding up by indent, not syntax. Also it folding up only some tags like html, body, div. tags like footer doesn't folding up.
ArtDesire
 
Posts: 26
Joined: Thu Dec 27, 2012 9:41 pm
Location: Canada


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 26 guests