I'd like to always use spaces instead of tabs for indentation in ST3.
I put these in my settings:
"translate_tabs_to_spaces": true,
"convert_tabspaces_on_save": true, // for a plugin
"detect_indentation": false,
"tab_size": 4
The setting convert_tabspaces_on_save
is for forcing the conversion tabs-> spaces at least on file save with the plugin ExpandTabsOnSave
But no matter what, ST3 keeps indenting new opened files using tabs instead of spaces.
Could it be a bug or am I using a wrong setting?
HINT: anytime I modify the file Preferences.sublime-settings
indirectly, for example by using the command Package Control: Disable Package
it is saved with tabs instead of spaces
According to the documentation, these settings should do the trick (they do 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 plugins, restart and look if the problem persists. If not, it's one of the plugins (or several conflicting ones). You can find out by enabling them one at a time and looking for the issue to reappear.
Try this: View -> Indentation -> Indent Using Spaces
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With