Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't IntelliJ use tabs?

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

like image 261
doub1ejack Avatar asked Jan 23 '17 15:01

doub1ejack


People also ask

How do I enable tabs in IntelliJ?

Open files in the preview tab and select the Enable Preview Tab option. You can also enable the preview tab in Settings/Preferences | General | Editor Tabs | Opening Policy.

How do I view tabs in IntelliJ?

The Show tabs in single row checkbox is selected on the Editor | General | Editor Tabs page of the IDE settings Ctrl+Alt+S . Some of the opened tabs are not visible because they do not fit in the editor window.


3 Answers

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

like image 112
grg Avatar answered Sep 18 '22 08:09

grg


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

Deselect it and try again.

like image 21
Rafael R. S. Robles Avatar answered Sep 21 '22 08:09

Rafael R. S. Robles


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.

like image 25
Wing Avatar answered Sep 20 '22 08:09

Wing