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 months ago
  • 28 minutes ago
  • 5 years ago

Installs

  • Total 172K
  • Win 84K
  • OS X 62K
  • Linux 26K
May 24 May 23 May 22 May 21 May 20 May 19 May 18 May 17 May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 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
Windows 53 178 156 35 39 150 159 151 151 146 33 23 145 138 150 154 116 33 44 130 146 166 173 65 36 29 135 132 175 167 169 41 35 149 168 169 164 131 40 34 106 156 180 158 157 35
OS X 31 83 106 27 15 97 89 91 108 86 23 27 76 85 80 80 96 17 36 76 87 84 96 50 31 26 73 95 92 92 74 17 25 81 79 106 95 50 18 23 58 85 105 102 91 28
Linux 20 36 45 7 15 36 49 47 59 33 16 8 43 40 48 39 38 15 16 32 38 39 46 23 11 10 39 29 60 45 38 13 19 47 45 36 36 34 7 6 39 30 39 39 45 13

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)