Sublime Text 3 always uses tabs instead of spaces for indentation

I would like to always use spaces instead of tabs for indentation in ST3.
I put them in my settings:

"translate_tabs_to_spaces": true, "convert_tabspaces_on_save": true, // for a plugin "detect_indentation": false, "tab_size": 4 

The convert_tabspaces_on_save parameter convert_tabspaces_on_save intended to force the conversion of tabs-> spaces, at least, to the save file with the ExpandTabsOnSave plugin

But no matter what, ST3 continues to backtrack from new open files, using tabs instead of spaces.

Maybe this is a mistake or am I using the wrong setting?

TIP : at any time, I indirectly change the Preferences.sublime-settings file, for example, using the Package Control: Disable Package command, it is saved with tabs instead of spaces

+6
source share
2 answers

According to the documentation, these settings should do the trick (they work for me):

 { // Integer. The number of spaces a tab is considered equal to "tab_size": 4, // Boolean, if true, spaces will be inserted up to the next tab stop when tab is pressed, rather than inserting a tab character "translate_tabs_to_spaces": true, // Boolean, if true (the default), tab_size and translate_tabs_to_spaces will be calculated automatically when loading a file "detect_indentation": true, // Boolean, If translate_tabs_to_spaces is true, use_tab_stops will make tab and backspace insert/delete up to the next tab stop "use_tab_stops": true } 

If this does not work, try disabling all the plugins, restarting them and see if the problem persists. If not, this is one of the plugins (or several conflicting ones). You can find out by turning them on one by one and look for the problem to reappear.

+5
source

have some problems, but otherwise - I would like to use tabs, but sl3 insert spaces. Its behavior is only for css / scss files! My user.config:

 { "font_size": 11, "ignored_packages": [ "Vintage" ], "tab_size": 2, "translate_tabs_to_spaces": false, "convert_tabspaces_on_save": false, "word_wrap": "false" 

}

0
source

Source: https://habr.com/ru/post/981658/


All Articles