How can I use tabs for indentation in IntelliJ IDEA?

前端 未结 9 1595
小蘑菇
小蘑菇 2021-01-30 09:35

How can I use tabs instead of multiple spaces for indentation in IntelliJ IDEA 11.0?

I have \"Use tab character\" checked under \"Code Style\" > \"General\" > \

9条回答
  •  失恋的感觉
    2021-01-30 10:21

    To expand on @Dmitiri Algazin 's answer: settings for individual languages are overridden by the general setting

    Preferences -> Code Style -> Detect and use existing file indents for editing
    

    So if you are wondering why your new settings are being ignored after changing your settings for a specific language, there is a chance this checkbox is ticked.

    As a side note; changing any default settings automamagically creates a settings profile clone (i.e. Default(1)) which I assume is in place so that the default IDE settings are never overwritten.

    It is a little confusing at first, really, whether editing Default settings or Project Settings is going to have any effect on your project, since you can select Default from the drop down menu and then edit from there.

    If you don't want to keep seeing random clones of Default populating your settings profiles, edit the Project Settings directly.

提交回复
热议问题