Search code examples
intellij-idea

Intellij: Change project indent from 4 spaces to 2 spaces


Currently, all of my project files are indented with 4 spaces. I want to change that to 2 spaces as my organization uses 2 as an standard, but can't find any answers.


Solution

  • Depending on your version of IDEA, it should be in your settings under:
    Editor > Code Style > (Specific language)

    **Edit: Example, in IDEA 2016: enter image description here

    If you don't see it there, I found mine by searching "indent" in the settings window.

    Finally, for organization-wide code settings, I highly recommend EditorConfig. It's compatible with just about every IDE out there and lets you enforce code style settings without requiring everyone to manually change their settings to match. IDEA supports it out of the box, without a plugin.