59

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.

Dariusz Woźniak
  • 9,640
  • 6
  • 60
  • 73
Stéphane Gerber
  • 1,388
  • 1
  • 17
  • 30
  • 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 Apr 17 '16 at 22:10

8 Answers8

105

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.
jenovachild
  • 1,671
  • 2
  • 14
  • 12
78

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

JayRizzo
  • 3,234
  • 3
  • 33
  • 49
Junchen Liu
  • 5,435
  • 10
  • 51
  • 62
  • 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 Apr 17 '16 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 Sep 16 '16 at 17:52
  • 1
    step 2 doesn't find anything like indent xml – cja May 31 '17 at 11:06
  • @cja I'm having the same issue. Nothing comes up when I type 'indent' or 'indent xml' or 'indentXml' – jenovachild Jun 25 '17 at 21:40
  • both of you what operating systems do youo use? i haven't got a mac or linux only tested on windows – Junchen Liu Jul 28 '17 at 23:05
  • Mine only listed it until I installed it. You could try Package Control > List Packages, and see if it is already installed. – ScottM Jul 05 '18 at 21:31
  • 1
    Indent XML can not be found until you choose Install Package first – vosicz Feb 05 '19 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.

JayRizzo
  • 3,234
  • 3
  • 33
  • 49
Kavan
  • 161
  • 1
  • 2
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/
JayRizzo
  • 3,234
  • 3
  • 33
  • 49
skuroda
  • 19,514
  • 4
  • 50
  • 34
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.

larp
  • 1,017
  • 1
  • 14
  • 23
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
fedorqui
  • 275,237
  • 103
  • 548
  • 598
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
pamcevoy
  • 1,136
  • 11
  • 15
0

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

  • 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? – Jeremy Caney Aug 27 '23 at 00:24