-
Notifications
You must be signed in to change notification settings - Fork 87
XML Formatting
After opening an XML document, use the Format Document
command, use SHIFT + ALT + F
(CTRL + SHIFT + I
on Linux, Option + Shift + F
on Mac), 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.
💡 Pro Tip
By default, XML namespace attributes are each given their own line in the formatted XML.
Don't like how that looks? Set thexmlTools.splitXmlnsOnFormat
setting tofalse
in your user or workspace settings file.
If you feel the urge to make your XML ugly again, use the XML Tools: Minify XML
command.
💡 Pro Tip
By default, your XML comments will remain intact when minifying XML.
To get rid of those comments, set thexmlTools.removeCommentsOnMinify
setting totrue
in your user or workspace settings file.
Copyright © 2016 - Josh Johnson