Sublime Forum

Expand XML (or other code)

#1

Is it possible to expand code that has been “minified” into a single line? Specifically, I want to take a single line of XML and have it automatically expanded and indented for editing.

0 Likes

#2

There’s a plugin called indent xml that does this. Read this thread:
https://forum.sublimetext.com/t/indent-xml/2717/1

0 Likes

#3

[quote=“sfranky”]There’s a plugin called indent xml that does this. Read this thread:
https://forum.sublimetext.com/t/indent-xml/2717/1[/quote]

This is almost what I’m looking for. I don’t suppose it is possible to do the same thing with other languages?

0 Likes

#4

Code folding is what you’re asking for. Sadly Sublime’s folding is pretty limited at the moment and only works based on indents. Also, it won’t save folds as part of a project.

A number of us are holding out for lexically-aware code folding in Sublime :smile:

0 Likes