0

Only trim trailing whitespace on lines that are not empty

Holger Weis 5 years ago • updated by Juha Mustonen 4 years ago 2
I have set trim_automatic_white_space to FALSE because I want to keep the indentation level on blank lines (e.g. after an if-statement). I also want any whitespace after non-empty lines to be automatically trimmed on save. Setting trim_trailing_white_space_on_save to TRUE will also remove the whitespace on empty lines (indentation level).

Is there a way to use trim_trailing_white_space_on_save TRUE with respect of trim_automatic_white_space FALSE?


You can make a plugin that takes care of that to your likings.

According to plugin documentation, TrailingSpaces -plugin is capable to do exactly what you wanted (among of other things).