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

Indent XML

by braver ALL Trending Top 100

Reindent XML and JSON files in Sublime Text

Labels indentation, xml

Details

Installs

  • Total 519K
  • Win 267K
  • Mac 180K
  • Linux 72K
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 Apr 8 Apr 7
Windows 35 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 58 18 16 41 59 41 51 49 10 19 40 45 36 33
Mac 27 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 42 7 9 33 33 24 41 32 9 9 29 32 26 29
Linux 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 8 0 2 8 14 9 6 5 0 4 11 4 9 8

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.