How can I use tabs for indentation in IntelliJ IDEA?

前端 未结 9 1752
小蘑菇
小蘑菇 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:32

    Have you tried .editorconfig? You can create this file in the root of your project and configure indentation for different file types. Your code will be automatically formatted. Here's the example:

    # top-most EditorConfig file
    root = true
    
    # matches all files
    [*]
    indent_style = tab
    indent_size = 4
    
    # only json
    [*.json]
    indent_style = space
    indent_size = 2
    

提交回复
热议问题