Search code examples
intellij-idea

IntelliJ sets tabs instead of spaces for indents, despite tabs being disabled. How to fix this?


When working on any of my personal projects, does IntelliJ IDEA (Community Edition, 2020.2) always use spaces instead of tabs when indenting a line.
This is how I want to have it.

The issue now is on another project I'm participating in. When I make indents there, does IntelliJ use tabs instead of spaces.
Checking the Code Style settings for Java (The language I code in) doesn't show anything out of the ordinary. The "Use tab character" is unchecked and the Tab size is set to 2, yet IntelliJ still uses the tab character.

Is there any file, format or secret setting that makes IntelliJ ignore my personal settings for that project and can I override it?


Solution

  • Settings (Preferences on macOS) | Editor | Code Style | Enable EditorConfig support -> Disable.

    Another possible case is the third-party code formatter plug-in enabled. Eclipse Code Formatter plug-in may have different settings.