2

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?

2 Answers 2

3

My problem was pressing enter had the auto indents, but it used tabs instead of spaces.

I got it to work after going to File -> Settings -> Editor -> Code Style, and on the General tab, unchecking the box that says, "Detect and use existing file indents for editing".

1
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.