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
  • 2 days ago
  • 1 hour ago
  • 5 years ago

Installs

  • Total 163K
  • Win 80K
  • OS X 59K
  • Linux 25K
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 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9
Windows 5 42 133 158 152 156 138 36 35 145 166 178 179 144 38 34 144 149 180 174 159 40 45 149 158 162 133 149 33 34 138 168 169 156 132 31 34 166 165 148 163 149 42 35 156 160
OS X 1 28 84 87 101 103 80 16 25 80 86 95 96 74 23 30 87 95 99 108 105 38 27 94 93 103 95 79 38 22 82 108 93 114 85 22 27 108 102 94 95 88 31 31 86 83
Linux 2 12 39 45 35 41 39 10 16 30 32 46 40 28 17 14 49 34 43 53 28 16 6 40 50 41 44 32 13 12 30 45 45 49 32 20 18 36 49 48 52 40 24 14 39 37

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)