8
votes

As per How can I use tabs for indentation in IntelliJ IDEA?, I have gone through and set each extension to "Use tab character" as seen below.

It doesn't work though - IntelliJ is still inserting spaces when I hit the tab button. Did I miss something? Where is intelliJ's [Please use tabs like I ef'ing told you to do] button?

(FYI, I'm using IntelliJ Ultimate 2016.2)

This looks promising... enter image description here

... but apparently it's all lies :(

enter image description here

3
just out of interest: why do you want to use tabs instead of spaces? I actually hate when people use tabs in shared code as the formatting is most of the time messed up on at least one machine or source-viewer. - Michael Ritter
@MichaelRitter it doesn't matter why he wants to do it, or that you hate when it is done. I hate spaced indentation. It is equally as messed up on at least one machine or source-viewer. But our preferences don't help answer the question. - Wing
@MichaelRitter Indent with tabs, align with spaces. It's the purpose of smart tab option - LoganMzz
I was having a similar issue and Smart Tabs were the problem. - Gru

3 Answers

3
votes

Maybe you have the option Settings->Editor->General->"Allow placement of caret inside tabs" checked.

Deselect it and try again.

7
votes

Go to SettingsEditorCode Style and deselect ‘Detect and use existing file indents for editing’.

1
votes

If you open up the .editorconfig file, you will see something akin to the following

# editorconfig.org  
root = true  

[*]  
indent_style = spaces  
indent_size = 2  
end_of_line = lf  
charset = utf-8  
trim_trailing_whitespace = true  
insert_final_newline = true

I changed it to tab and 4, closed the project and reopened it.
I know this is an absurd step to have to take, and have an open bug report with them about it.