ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Indent XML

by alek-sys ST2/ST3 Top 100

Plugin for Sublime Text editor for reindenting XML and JSON files

Details

  • 2017.03.23.23.32.07
  • github.​com
  • github.​com
  • 1 month ago
  • 53 minutes ago
  • 5 years ago

Installs

  • Total 168K
  • Win 82K
  • OS X 60K
  • Linux 25K
Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10
Windows 112 41 35 149 168 169 164 131 40 34 106 156 180 158 157 35 32 133 163 192 176 128 30 40 148 178 160 162 162 33 42 133 158 152 156 138 36 35 145 166 178 179 144 38 34 144
OS X 44 17 25 81 79 106 95 50 18 23 58 85 105 102 91 28 24 98 105 101 84 98 21 23 79 90 100 112 105 21 28 84 87 101 103 80 16 25 80 86 95 96 74 23 30 87
Linux 22 13 19 47 45 36 36 34 7 6 39 30 39 39 45 13 10 31 50 49 44 28 13 10 29 31 34 39 36 13 12 39 45 35 41 39 10 16 30 32 46 40 28 17 14 49

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 guy) and then chose “Indent XML”

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)