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.
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.
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.
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.
You can use ctrl+ ] to indent a line (or highlighted block), and ctrl + [ to unindent.
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.
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