Sublime Forum

Automatically trim trailing space?

#1

Is there an option to automatically trim trailing space from all the lines in a file? Or a hotkey that will do the same thing?

1 Like

#2

There’s an option that you can set to do this on save:
You can add this to your File Settings – User config file under the preferences menu.

// Set to true to removing trailing white space on save "trim_trailing_white_space_on_save": true

All of the default options can be found in the *Settings – Default files in that same menu. To customize any of them copy just the ones you care about into the User settings file of the same name and override them.

3 Likes

#3

You can also/instead setup a shortcut that uses “trim_trailing_white_space” command.

0 Likes

#4

Awesome! Thanks.

0 Likes