Indenting two spaces per tab is useful when programming in languages like Ruby. I was able to search for an easy way to do this in Sublime Text 2 but it took me sometime to figure out how to get this right for Sublime Text 3.
Here's how we can set this as a default for a user in Sublime Text 3
Step 1 : Sublime Text -> Preferences -> Settings - User. (Please read the PS below if you're a linux user)
Step 2 : Within the existing set of flower brackets("{}") that are specific to the user we need to add customized settings to override the default settings that one would find in Preferences -> Settings - Default. We need to add the below settings to use two space indentation -
Below is an example of how the user settings file would look like after you override the default settings with the above changes.
Step 3: Save the changes and you should be good to go.
P.S: Surprisingly, I found the Preferences section for the debian package(I had it installed on Ubuntu 14.04) of Sublime Text 3 at a different location than where it is when one sets up the same through Mac OSx.
Here's how we can set this as a default for a user in Sublime Text 3
Step 1 : Sublime Text -> Preferences -> Settings - User. (Please read the PS below if you're a linux user)
Step 2 : Within the existing set of flower brackets("{}") that are specific to the user we need to add customized settings to override the default settings that one would find in Preferences -> Settings - Default. We need to add the below settings to use two space indentation -
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// 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 | |
} |
Below is an example of how the user settings file would look like after you override the default settings with the above changes.
Step 3: Save the changes and you should be good to go.
P.S: Surprisingly, I found the Preferences section for the debian package(I had it installed on Ubuntu 14.04) of Sublime Text 3 at a different location than where it is when one sets up the same through Mac OSx.