Question

I know that sublime has the following space-related settings:

Preferences.sublime-settings

{
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "use_tab_stops": false
}

I think this means:

  • tab_size: When I press Tab I get 4 spaces (or a tab length of 4, depending on wheather it makes tabs or spaces)
  • translate_tabs_to_spaces: When I save a document it will translate tabs to spaces
  • use_tab_stops: (only relevant for spaces) Sublime will not simply enter 4 spaces, but will eventually add less spaces to get to the next tab position.

But although I have this configuration, I see all the time:

enter image description here

My project.sublime-project has:

...
"settings":
{
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "use_tab_stops": true
}
...

How can I tell sublime to always use 4 spaces? (except for Makefiles, where it has to use tabs. But the focus of thes question is on 4, not on spaces)

I have Linux Mint 16 Petra and Sublime Text build 3059

Was it helpful?

Solution

The problem you have stated is happening because your current file has indentation of 2 spaces and ST is using the auto detected indention as it has the highest priority in all Preferences1.
Add below line to Preferences
"detect_indentation": false
So that it won't change the indentation setting automatically.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top