How can I use tabs for indentation in IntelliJ IDEA?

前端 未结 9 1593
小蘑菇
小蘑菇 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
    
    0 讨论(0)
  • I have started using IntelliJ IDEA Community Edition version 12.1.3 and I found the setting in the following place: -

    File > Other Settings > Default Settings > {choose from Code Style dropdown}
    
    0 讨论(0)
  • 2021-01-30 10:38

    File > Settings > Editor > Code Style > Java > Tabs and Indents > Use tab character

    Substitute weapon of choice for Java as required.

    0 讨论(0)
提交回复
热议问题