Reputation: 5370
It happens many times when we need to remove a line end and unnecessary space between an HTML element. So this could be proven as a time-saving technique.
Upvotes: 38
Views: 71608
Reputation: 1
always trim on saving for sublime 4 (build 4169)
in Preferences.sublime-settings use two params:
"trim_trailing_white_space_on_save": "all",
"trim_only_modified_white_space": false,
Upvotes: 0
Reputation: 545
You can also use \n+ to remove all the unwanted space. If you want to use a single line then replace with \n online.
Upvotes: 4
Reputation: 12882
In your Sublime Text user settings, you can specify the following to trim trailing white space.
"trim_trailing_white_space_on_save": true
You might want to have a look at the Trimmer that has a couple of options to trim whitespace.
Upvotes: 8
Reputation: 17797
\n\s+
in the search field, clear the replace fieldThis will remove all newlines (\n+
) followed by all whitespace (\s+
) in the next line.
Upvotes: 86