Sublime Text automatically removes my indent

5

1

I recently updated my copy of Sublime Text to 3. Everything is awesome, except one thing that is driving me crazy. Whenever I indent my line with the tab key, it automatically undoes it. I then have to hit tab a second time for it to 'stick'.

Example

<html>
    <body>
    </body>
</html>

This is how I want my HTML to be presented, however, when I open the bracket of the 'body' tag, sublime automatically adjusts my line to

<html>
< -- I don't want to type here, Sublime!
</html>

I then have to delete my '<' and hit tab a second time. At this point it will allow me to type with the indent.

I expect this is some kind of preference that has been enabled, but I have no idea what to look for.

Anyone know how I can change this?

Thanks

user1537360

Posted 2014-03-30T14:44:44.677

Reputation:

this quetion is not suitable for stackoverflow, should be moved to superuser. I flagged it, will probably me moved in the next minutes – ederollora – 2014-03-30T14:47:48.150

Answers

5

Add "trim_automatic_white_space": false to your user settings. When set to true, auto indent tabs will be automatically removed when the cursor is moved off of the line.

skuroda

Posted 2014-03-30T14:44:44.677

Reputation: 181

1This is not an issue with the answer, just an FYI. Once you do set this to false, then when you close a tag, Sublime will not "unindent" to match the indentation of the opening tag. – doubletap – 2016-11-04T17:45:32.607

Dangit! I wish I could vote this up more than once. That was getting on my last nerve when I came across this SO q/a. Oh, I guess this isn't SO... anyway, whatever. – Stack Underflow – 2018-02-08T03:21:30.673

0

Try disabling your 'auto_indent' or 'smart_indent' settings (from True to False).

Here's a link to additional indentation settings:

http://www.sublimetext.com/docs/3/indentation.html

Will

Posted 2014-03-30T14:44:44.677

Reputation: 101