If you want it for all files, go to Preferences -> Settings - Default/User
. But as several comments below indicate, Syntax Specific settings can limit it to just the languages you choose.
To limit this configuration to Ruby files, first open up a Ruby file in the editor, and then go to Preferences -> Settings - Syntax Specific
. This should open a settings window named Ruby.sublime-settings
Save these settings:
{
"tab_size": 2,
"translate_tabs_to_spaces": true,
"detect_indentation": false
}
Repeat for any other syntax types by opening a file of that type and going back to the preferences to open the correct preferences file for that syntax.
I have edited this to include the "detect_indentation" line per the requests in comments; I previously used the Default/User to set my tab size, and have not needed the tab detection, but whether that is due to the global config or due to the fact that I have rarely opened files with tabs, I do not know.
Restarting should not be necessary, although in some instances it can be.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…