Sublime Forum

FR - - "trim_empty_lines_on_save": true`?

#1

Subject : Feature Request – Native “Remove Empty Lines on Save” Setting

Currently, Sublime Text offers trim_trailing_white_space_on_save to remove spaces at the end of lines, but it does not remove entirely empty lines (blank interlines).

So without installing third-party plugins like DeleteBlankLines or using manual Regex replacements every time.

Suggestion: why not a "trim_empty_lines_on_save": true ?

This option would automatically remove consecutive blank lines or single empty lines upon saving, similar to how trailing spaces are handled. This would streamline the workflow, improve code cleanliness by default, and reduce the dependency on external plugins for basic formatting tasks.

Thank you for considering this improvement!

So maybe it’s not really “modern” idea ( i am a newbe), but in all case thanks for this useful modern soft clear and solid .
(i don’t give my name because i don’t want to be “searchable” without real dialog and i don’t want to be member of a community where i know nobody personaly and deliberatly so i am modern of this modernity …)

0 Likes

#2

trim_trailing_white_space_on_save does remove white space on empty lines. However the trim_only_modified_white_space setting - which is enabled by default - makes it so that only white space you added with Sublime Text is removed. Perhaps that is the behavior you’re seeing.

0 Likes