I would like change the basic indentation on template ruby haml. He is set when I create a new file to 'Tab Size: 4' How change it in 'Spaces: 2'?
Thanks.
I would like change the basic indentation on template ruby haml. He is set when I create a new file to 'Tab Size: 4' How change it in 'Spaces: 2'?
Thanks.
To change the indentation settings just for ruby files create a new file named Ruby.sublime-settings
, based on your OS, in
%APPDATA%\Sublime Text 2\Packages\User
or
~/Library/Application\ Support/Sublime\ Text\ 2/Packages/User/
or
~/.config/sublime-text-2/Packages/User/'
with the following content:
{
// The number of spaces a tab is considered equal to
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true
}
There is a better and easier way to set the indentation. To change indentation for all file types go to:
Preferences -> Settings - Default/User
To change indentation for a specific file type, open a file type of your choice in the editor, and then go to:
Preferences -> Settings -> More -> Syntax Specific -> User
In both cases Sublime Text will open a file called Ruby.sublime-settings
. Save the following settings:
{
"tab_size": 2,
"translate_tabs_to_spaces": true
}
You can read more about this in this SO question.
To change indentation within the document, go to View > Indentation > Convert Tabs to Spaces
. To make this change within the document for future edits, go to View > Indentation > Spaces Width: 2
. Additionally, if you have the status bar visible, you can you can click where it says Tab Size: 4
and change the indentation here from the context menu.