Intellij indents 4 spaces when I have configured i

2019-04-19 13:12发布

问题:

On Intellij IDEA 14, I have tried to set my preferences in Editor > Code Style > LESS to do 2 space indents but no matter what I do, my code ends up getting formatted with 4 space indents. How do I get it to do 2 space indents for LESS?

回答1:

If your project has an ".editorconfig" file, IntelliJ 14 uses that by default (which overwrites your settings). If you absolutely do not wish to use these settings, you need to disable the editorconfig plugin.



回答2:

Not as likely, but if you make a scratch buffer and rename it to filename.ext. It does not honor the code style for *.ext, it defaults to tabs. You have to copy the scratch buffer to a real file and then it will apply the code style for *.ext.