Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable smart HTML tag indenting in Sublime Text 3?

I don't remember exactly when this functionality stopped working, but I always had Sublime Text do auto indenting properly. For example, if I type <div> and then press Enter, the caret would automatically make a tab on the next line. Similarly, when I closed tags, they would automatically un-indent by one tab (such as when pressing alt+. in order to close a tag).

This functionality seems to have disappeared, at least in ST3, and I can't find any way to get it back. Anyone have any ideas?

Edit: it might be useful to add that PHP auto-indenting works just fine, such as making indentation between brackets.

like image 573
timetofly Avatar asked Aug 07 '13 21:08

timetofly


People also ask

How do I indent HTML in Sublime Text?

One option is to type [command] + [shift] + [p] (or the equivalent) and then type 'indentation'. The top result should be 'Indendtation: Reindent Lines'. Press [enter] and it will format the document.

How do I change the default indentation in Sublime Text 3?

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.

How do I align codes in Sublime Text 3?

Install the Sublime Alignment package in Sublime Text ↩Command-Shift-P to open Command Palette. Type Install until you see Package Control: Install Package . When the list of packages appears, type Alignment until you find it. Press Enter to install Sublime Alignment.

How do I indent a block in Sublime Text?

You can use ctrl+ ] to indent a line (or highlighted block), and ctrl + [ to unindent.


1 Answers

You can install "Tag" plugin using package control. This question suggests the plugin has issues, but I haven't noticed any that would be a problem.

like image 73
Oleg Avatar answered Nov 15 '22 06:11

Oleg