0
votes

I would like to write code in Sublime Text 3 so that whenever I'm already indented some amount of spaces and then press Enter to skip a line, the skipped line retains the same indentation, as opposed to collapsing down to nothing.

In other words, I want the following to automatically happen when I am indented by two spaces and press the Enter key multiple times:

enter image description here

Instead though, I get the following (note the missing spaces on lines 2 and 4):

enter image description here

Is there any way to set up Sublime Text 3 to always retain those extra spaces when I press Enter to add multiple lines? Thank you.

1

1 Answers

1
votes

Yes, you can set the following preference in your user preferences file to ensure the spaces remain:

// Trims white space added by auto_indent when moving the caret off the
// line.
"trim_automatic_white_space": false,