Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I setup tab size in Sublime text 2 for each file type?

Tags:

For example, in *.asm files I need a tab size that equals 20 spaces, and in *.cpp files - 2 spaces.

like image 867
Vorgin Avatar asked Dec 19 '12 16:12

Vorgin


People also ask

How do I change the tab size in Sublime Text?

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.

How do I change tabs in sublime?

Use Cmd (Mac) or Alt (Windows) with the number keys 0–9 to switch between tabs in Sublime Text. For example hit Cmd–2 (Mac) or Alt–2 (Windows) to switch to the second tab. You can also use Ctrl–Tab (Mac and Windows) to cycle through your tabs.

How do I fix sublime spacing?

"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.

How do I change the indentation in Sublime Text?

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.


1 Answers

Open a .asm file in Sublime Text.

Then edit syntax specific settings with menu Preferences -> Settings - More -> Syntax Specific - User:

{     "tab_size": 20 } 

You can do the same with any other file type.

like image 117
Riccardo Marotti Avatar answered Oct 11 '22 19:10

Riccardo Marotti