63

I am trying to install https://github.com/alek-sys/sublimetext_indentxml in sublime text 3. I read

In Sublime Text 3 - clone project from Github into Packages folder.

Doesn't seem to work.

I am not sure where the Packages folder is.

1
  • I have it "installed", but I don't see anything referencing usage after it's installed. I can't find it in the menus, despite files existing in the directories referenced in the answers below. Any helpful hints re: how to use this thing once it's installed?
    – Adrian
    Commented Apr 17, 2016 at 22:10

9 Answers 9

112

None of the above answers worked for me as they appeared to be missing a crucial 'step' to the process (step 2 below). This is how I got it to install for me in Windows using Sublime Text 3:

  1. Install Package Control (Tools > Install Package Control...)
  2. Open Package Control (Ctrl+Shift+P) and type 'Package Control: Install Package' and then press Enter.
  3. Sublime will attempt to load any custom repositories then offer a list of packages available.
  4. At this point, I was able to successfully search for 'indent xml' and have it appear in the list and install by pressing Enter with it selected.
5
  • 9
    There is nothing in package control that is called indent xml Commented Oct 21, 2017 at 4:11
  • 5
    It is called IndentX and works as @1247p describes bellow. Commented Dec 7, 2018 at 9:35
  • 2
    Dimitri, I think you missed to do #2 like me. These steps work
    – nilesh
    Commented Jan 23, 2019 at 20:15
  • 3
    indent xml is already added in sublime text 3. no need to add. select all xml code, press (Ctrl+Shift+P), type indent xml and hit enter
    – Shrirang
    Commented Mar 18, 2020 at 9:54
  • 1
    @Shrirang Nothing appears typing "indent xml"
    – DATALOT
    Commented Jan 6, 2021 at 23:09
83

The most error free way, is to

  1. Install the Package Control First
  2. Ctl + shift + P then type Install Package and press Enter
  3. Type Indent XML and press Enter

To Use:

  1. Open the XML file that you need to reformat
  2. Ctl + shift + P then type Indent XML
  3. Press Enter

Your Document will then update.

For information how to install the package control please see:

https://packagecontrol.io/installation

And

https://packagecontrol.io/docs/usage

7
  • 1
    I've done everything in the directions you referenced, closed the app and relaunched. Once I've got it "installed", how do I get the XML to indent?
    – Adrian
    Commented Apr 17, 2016 at 22:11
  • @Adrian Package Control is a GUI package manager, once install go in Sublime Text 3 and click on the preference Tab, then click on Package Control, install package, after type indentXml
    – Alegrowin
    Commented Sep 16, 2016 at 17:52
  • 1
    step 2 doesn't find anything like indent xml
    – cja
    Commented May 31, 2017 at 11:06
  • @cja I'm having the same issue. Nothing comes up when I type 'indent' or 'indent xml' or 'indentXml' Commented Jun 25, 2017 at 21:40
  • 1
    Indent XML can not be found until you choose Install Package first
    – vosicz
    Commented Feb 5, 2019 at 10:04
16

If you are using Mac, go to the menu as follows:

Sublime Text --> Preferences --> Package Control --> Install Package

When the list box opens, type indent xml ( or a different package indentx ).

Once the package is installed, Command+Shift+P

Then choose indent xml to automatically format your file.

1
  • THE BEST ANSWER EVER..
    – chinna_82
    Commented Aug 16, 2022 at 8:45
13

Try this (for Windows only):

Open Sublime Text 3

Ctrl+Shift+P

Type: Package Control: Install Package

Then lastly type: indent XML

after installing the package open an XML file then press Ctrl+K next press Ctrl+F or you can go to Selection->Format->Auto Indent.

1
  • 1
    Format -> auto indent saved me
    – nakeer
    Commented Aug 10, 2018 at 23:47
13

The location is system dependent, but are located at:

  • OS X: ~/Library/Application Support/Sublime Text 3/Packages/
  • Windows: %APPDATA%/Sublime Text 3/Packages/
  • Linux: ~/.config/sublime-text-3/Packages/
0
1
  1. Use Package Control (Preference > Package Control) to install Indent XML.
  2. Then you can run the package by hitting Ctl + shift + P and then typing indent xml
0

I was able to format XML without installing anything via Package Control.

  1. Rename the file to end with .xml
  2. Open the file into SublimeText
  3. Select all
  4. Right click -> HTML/CSS/JS Prettify -> Prettify Code
0

It works by manually copying the contents of the zip file under ~/Library/Application Support/Sublime Text 3/Packages/

1
  • 2
    Thank you for your interest in contributing to the Stack Overflow community. This question already has quite a few answers—including one that has been extensively validated by the community. Are you certain your approach hasn’t been given previously? If so, it would be useful to explain how your approach is different, under what circumstances your approach might be preferred, and/or why you think the previous answers aren’t sufficient. Can you kindly edit your answer to offer an explanation? Commented Aug 27, 2023 at 0:24
0

Need to make sure the package Indentor.sublime-package is installed.

Install the Package Control First

Ctl + shift + P then type Install Package and press Enter

  • Type Indentor and press Enter

Ctl + shift + P then type Install Package and press Enter

  • Type Indent XML and press Enter

enter image description here

To Use: Open the XML file that you need to reformat Ctl + shift + P then type Indent XML Press Enter

Not the answer you're looking for? Browse other questions tagged or ask your own question.