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
  • 3 months ago
  • 32 minutes ago
  • 6 years ago

Installs

  • Total 176K
  • Win 86K
  • OS X 63K
  • Linux 27K
Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7 Jun 6 Jun 5 Jun 4 Jun 3 Jun 2 Jun 1 May 31 May 30 May 29 May 28 May 27 May 26 May 25 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
Windows 45 148 152 185 139 23 31 145 148 204 153 132 31 37 149 170 150 154 119 30 32 146 156 151 142 103 34 39 135 147 163 178 156 35 39 150 159 151 151 146 33 23 145 138 150 154
OS X 23 88 93 98 109 24 23 66 75 88 88 81 15 20 78 91 85 105 71 21 38 83 86 89 80 51 16 29 58 70 89 83 106 27 15 97 89 91 108 86 23 27 76 85 80 80
Linux 13 36 45 45 39 12 8 36 43 45 47 37 15 9 37 31 38 29 39 14 14 27 33 53 31 30 11 19 37 36 44 36 45 7 15 36 49 47 59 33 16 8 43 40 48 39

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)