Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change XML indentation in IntelliJ IDEA?

By default IntelliJ IDEA 7.0.4 seems to use 4 spaces for indentation in XML files. The project I'm working on uses 2 spaces as indentation in all it's XML. Is there a way to configure the indentation in IntelliJ's editor?

like image 498
Sindri Traustason Avatar asked Sep 01 '08 13:09

Sindri Traustason


1 Answers

Sure there is. This is all you need to do:

  • Go to
File -> Settings -> Global Code Style -> General
  • Disable the checkbox next to 'Use same settings for all file types'
  • The 'XML' tab should become enabled. Click it and set the 'tab' (and probably 'indent') size to 2.
like image 198
Huppie Avatar answered Oct 11 '22 17:10

Huppie