Brian Armstrong
Brian Armstrong

Reputation: 19873

Sublime Text 2 tab_size setting not correctly activated

I have the following in my user/Preferences.sublime-settings

{
    "tab_size": 2,
}

And most of the time it works. But once in a while I open a ruby file, and it jumped back to 4 spaces. I'm wondering if there is some bug or slight difference in opening a file that could change this?

Having trouble tracking this down. Thanks for the help.

Upvotes: 19

Views: 5661

Answers (2)

ferik
ferik

Reputation: 531

You'll want to add:

"detect_indentation": false

This is on by default and ST is trying to be smart detecting the indentation of your current file, overloading the user or syntax specific default.

Upvotes: 14

Mikko Ohtamaa
Mikko Ohtamaa

Reputation: 83706

Here are various Sublime Text 2 tab settings explained:

http://opensourcehacker.com/2012/05/11/sublime-text-2-tips-for-python-and-web-developers/#Configure_sane_tab_and_whitespace_policy_and_other_settings

  • Note that the tab setting may be per file type

  • There is also autodetect from file enabled by default and your source code file may contain bad tabbing

Upvotes: 7

Related Questions