0

In Sublime, when you hit return, it auto-indents the new line, according to syntax. However, if I hit return more than once, going multiple lines down, the previous lines do not remain indented. They have no indentation at all, and if I wish to go back to them to add something, I have to manually indent them.

Sometimes I like to have some white space in my code for aesthetic reasons. Is there a solution to this? Some other editors leave the lines indented in this use case.

2
  • I have a hunch this is by design, as to not waste space with "unused" indents in source code. Then again, it could be a bug..
    – Kristian
    Jan 27, 2015 at 23:17
  • I figured it out. It's the setting "trim_automatic_white_space". Enabled by default, and setting it to false creates the behavior I want. :) Jan 28, 2015 at 0:07

2 Answers 2

2

Figured it out. Setting "trim_automatic_white_space" to false (true by default) creates the behavior I want. Nice to know there was so much thought put into this editor as to include that option.

2
  • This has been bugging me for quite some time as well. Not badly... Just one of these little voices in the back of your head. (But I have lots of voices in my head so that's ok... :/ ) Your question inspired me to actually go and take a look at the sublime options. I found the same setting, was just going to post an answer when I saw that you answered your own. But MAN are there a lot of cool settings to play with \o/ Sublime FTW.
    – SadBunny
    Jan 28, 2015 at 0:12
  • I will accept it but it says I can't accept my own answer until two days have passed—probably because this is a new account. But thanks! Jan 28, 2015 at 0:18
1

Default:  "trim_automatic_white_space": true,

Trims white space added by auto_indent when moving the caret off the line.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.