I was unable to find a solution to format simple bits of HTML/XML/RDF/XUL ( some invalid ), then I created "TagIndent" plugin:
Apply and/or add beauty indentation to HTML/XML/RDF/XUL tags found on selection(s).
There is a context menu item called "Indent Tags on Selection"
There is also a Main menuitem: Edit -> Tag -> "Indent Tags on Selection".
There is also a command called "Indent Tags on Selection".
Aims to add and/or apply correct indentation to little portions of HTML or XML, not to complete documents.
It takes the starting "indentation level" from the first line of each selection and sums tabs as needed.
On empty tags, and on tags with less than 40 characters, it writes the tag in one line.
Short-cut is "ctrl+shift+h"
Source / Installation
- Repository moved to SublimeText Organization at github.
- Support self closing tags.