Indent XML
Plugin for Sublime Text editor for reindenting XML and JSON files
Details
Installs
- Total 511K
- Win 263K
- Mac 177K
- Linux 71K
| Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | Dec 10 | Dec 9 | Dec 8 | Dec 7 | Dec 6 | Dec 5 | Dec 4 | Dec 3 | Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Windows | 1 | 41 | 38 | 32 | 23 | 33 | 12 | 19 | 31 | 28 | 17 | 20 | 23 | 21 | 27 | 26 | 34 | 14 | 20 | 36 | 42 | 34 | 48 | 34 | 13 | 10 | 32 | 53 | 37 | 52 | 42 | 8 | 16 | 54 | 47 | 45 | 41 | 35 | 16 | 20 | 47 | 45 | 48 | 52 | 35 | 16 |
| Mac | 0 | 31 | 24 | 9 | 9 | 25 | 1 | 13 | 22 | 30 | 8 | 3 | 5 | 8 | 15 | 23 | 27 | 9 | 10 | 17 | 31 | 39 | 40 | 23 | 8 | 16 | 36 | 41 | 45 | 43 | 37 | 7 | 7 | 51 | 43 | 44 | 36 | 25 | 9 | 5 | 31 | 24 | 38 | 44 | 32 | 3 |
| Linux | 0 | 7 | 7 | 6 | 3 | 9 | 5 | 4 | 6 | 6 | 4 | 4 | 3 | 6 | 6 | 10 | 11 | 2 | 2 | 6 | 12 | 4 | 9 | 8 | 2 | 3 | 8 | 11 | 7 | 8 | 5 | 11 | 1 | 12 | 13 | 6 | 7 | 10 | 3 | 5 | 5 | 11 | 8 | 11 | 13 | 1 |
Readme
- Source
- raw.githubusercontent.com
SublimeText Indent plugin
What is the goal of Indent plugin? Short answer is converting this XML
<root><node attr="1" attr2="4"><node /></node></root>
to this:
<root>
<node attr="1" attr2="4">
<node/>
</node>
</root>
Looks good? It also can convert this JSON
{ "root": [ { "field": "val1", "field2": "val2" }, { "arr": [1, 3, "three"] }] }
to this
{
"root": [
{
"field": "val1",
"field2": "val2"
},
{
"arr": [
1,
3,
"three"
]
}
]
}
Want more? It can indent only selected text - including multiple selections and even mixed XML / JSON selections. It is smart enough to recognize XML or JSON even if you are editing plain text. Indent plugin won’t mess up your keyboard shortcuts because it uses “chord” command Ctrl+K, Ctrl+F (this mean hold Ctrl, press K then press F, release Ctrl) and also available in “Selection” menu.
Supported Sublime Text versions
Indent plugin supports both Sublime Text 2 and Sublime Text 3
Installation
Just use Package Control and search for “indent xml” plugin
Usage
Click on Tools->Command Pallette… (or Ctrl+shift+P if you're a keyboard person) and then chose “Indent XML”
Settings
Currently this plugin performs patching of xml.dom.minidom.CDataSection class in order to fix CDATA indenting in toprettyxml function. This can be disabled in indent_xml.Sublime-settings file by setting disable_patch_minidom to true.
Feedback & Support
Available on Github
Contribution
…is always welcome! Same place - Github
License
This software is distributed under MIT license (see License.txt for details)