sublime 3 tabs and spaces do not match

前端 未结 1 889
無奈伤痛
無奈伤痛 2021-01-28 10:28

I have browsed the web 3 times over but still no solution.

I have a simple js file, and I want my tabs to be 4 spaces instead of 2.

I changed the preferences set

相关标签:
1条回答
  • 2021-01-28 10:37

    Click On the indentation information on the status bar, that's where it says either Tab Size: num or Spaces: num, and a context menu will be displayed.

    Image of ST Status Bar

    Assuming the starting position of a file using indentation with spaces and a width of 2, follow the following procedure to convert to indentation with spaces and a width of 4.

    Convert from spaces to tabs, change the width, and then convert back to spaces, like this:

    • Un-Tick: Indent Using Spaces
    • Click: Convert Indentation to Tabs
    • Tick: Tab Width: 4
    • Tick: Indent Using Spaces
    • Click: Convert Indentation to Spaces
    • That's it. :)

    If indenting with spaces with a width of 4 is what you want to use by default in all your files, then set these settings in your user preferences and bear in mind that they can be overridden by your project settings and syntax specific settings:

    // The number of spaces a tab is considered equal to
    "tab_size": 4,
    
    // Set to true to insert spaces when tab is pressed
    "translate_tabs_to_spaces": true,
    
    0 讨论(0)
提交回复
热议问题