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

Indent XML

by braver ALL Top 100

Reindent XML and JSON files in Sublime Text

Labels indentation, xml

Details

Installs

  • Total 519K
  • Win 267K
  • Mac 180K
  • Linux 72K
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 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
Windows 26 31 32 40 29 0 0 0 0 0 0 0 4 9 40 50 44 26 42 14 14 34 34 38 39 33 11 16 36 55 45 39 31 16 11 19 38 41 45 31 9 15 31 45 54 41
Mac 24 32 33 37 23 0 0 0 0 0 0 0 0 6 33 31 43 36 30 8 7 23 25 32 28 34 9 14 29 36 34 38 36 6 8 14 41 37 40 33 7 9 26 33 27 35
Linux 5 7 10 10 3 0 0 0 0 0 0 0 0 3 8 8 9 9 7 9 4 13 4 17 14 7 4 5 8 5 12 7 12 4 3 3 8 10 9 5 4 5 6 7 13 9

Readme

Source
raw.​githubusercontent.​com

Indent XML and JSON in Sublime Text

Auto-indent data structures in XML or JSON format to readable format. Uses Python's xml.dom.minidom and json libraries under the hood to go from …

<root><node attr="1" attr2="4"><node /></node></root>

… to this:

<root>
    <node attr="1" attr2="4">
        <node/>
    </node>
</root>

Features

  • Indent only selected text
  • Supports multiple selections of XML and JSON data
  • Detects format based on syntax or heuristics (in plain text)
  • Commands are available via the Selection menu, the command palette and keyboard shortcuts.

Key bindings

Uses the Ctrl+K, Ctrl+F “chord” command, meaning hold Ctrl, press K then press F, release Ctrl. On MacOS use Cmd instead of Ctrl.

Installation

Just use Package Control and search for the “Indent XML” plugin, or copy the install command from the PC page for this package.

Testing

  • Have both Indent XML and UnitTesting installed manually in the ST Packages directory.
  • Run the ./run_tests.sh script.

Buy me a coffee

Please feel free to make a little donation towards the coffee that keeps this labour of love running. It's much appreciated!


Originally forked from alek-sys/sublimetext_indentxml.