Intellij: Change project indent from 4 spaces to 2 spaces

Intellij Idea

Intellij Idea Problem Overview


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.

Intellij Idea Solutions


Solution 1 - Intellij Idea

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRiwaz PoudyalView Question on Stackoverflow
Solution 1 - Intellij IdeaJames TannerView Answer on Stackoverflow