Sublime Text 2: Trim trailing white space on demand
Beware: using this plugin makes Sublime Text significantly slower
I use TrailingSpaces plugin for this.
Highlight trailing spaces and delete them in a flash.
ST2 provides a way to automatically delete trailing spaces upon file save. Depending on your settings, it may be more handy to just highlight them and/or delete them by hand. This plugin provides just that!
Usage: click "Edit / Trailing Spaces / Delete".
To add a key binding, open "Preferences / Key Bindings - User" and add:
{ "keys": ["ctrl+alt+t"], "command": "delete_trailing_spaces" }
I use these steps for a quick on-demand solution within Sublime Text:
- Find > Replace...
- Find What:
[ \t]+\n
- Replace With:
\n
- Replace All
You could also do this for a large set of files via
- Find > Find in Files...
- Find:
[ \t]+\n
- Where:
- Replace:
\n
- Replace