Ad

How Do I Change XML Indentation In IntelliJ IDEA?

- 1 answer

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?

Ad

Answer

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.
Ad
source: stackoverflow.com
Ad