Format Ugly XML
After opening an XML document, use the
Format Document command, use
SHIFT + ALT + F (
CTRL + SHIFT + I on Linux), or right-click the document and click
Format Document. You can also highlight a subset of XML (as long as it is a valid, well-formed XML node) and perform the same actions.
v1.8.0+: You can format any document or selection as XML by using the
Format as XML command.
By default, XML namespace attributes are each given their own line in the formatted XML.
Don't like how that looks? Set the
falsein your user or workspace settings file.
Minify Formatted XML
If you feel the urge to make your XML ugly again, use the
XML Tools: Minify XML command.
By default, your XML comments will remain intact when minifying XML.
To get rid of those comments, set the
truein your user or workspace settings file.