EDIT : Use Tag Package instead.
I was unable to find a solution to format simple bits of HTML/XML/RDF/XUL ( some invalid ), then I created “TagIndent” plugin:
Usage
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
Aims to add and/or apply correct indentation to little portions of HTML or XML, not to complete documents.
Information
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
github.com/SublimeText/TagIndent
Update:
- Repository moved to SublimeText Organization at github.
- Support self closing tags.