How do I configure the Sublime Text 3 settings so that a specific file type has its own tab size? I want ruby to 2 tab size, python = 4, C++ = 4, etc. How do I do this without manually doing so every time?
To configure the tab width in Sublime Text 3, click on “View” in the top bar, then click on “Indentation” in the drop-down list. Next, in the second level of the drop-down list select the width you want a tab to take up. Sublime Text 3 defaults to tabs being four spaces wide.
"cmd+f" => " "(two spaces) => "alt+enter" => "arrow right" => " "(two more spaces) => set tab width to 4(this can be done before or after. On windows or other platforms change cmd+f and alt+enter with whatever your find and select all hotkeys are.
Changing default indentation settings The following File Type Preferences determine the indentation settings: translateTabsToSpaces: set to either 'true' or 'false'. If true, then when tab is pressed, an equivalent number of spaces will be inserted into the buffer instead. Defaults to false.
Select all code that you intend to indent, then hit Ctrl + ] in Sublime text to indent. For macOS users, use command + ] to indent, and command + [ to un-indent.
Do the following for each file-type:
1- Go to
Preferences -> Settings -> More -> Syntax Specific -> User
Note: Might change slightly depending on your OS
2- Sublime-Text
will open a file for editing, check the filename: should be called something like Python.sublime-settings
.
3- Add the following content to the file and save it.
{ "tab_size": 4 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With