Trailing whitespaces make a lot of noise in a revision control system.
This is a Vim script to highlight trailing whitespaces and then strip them.
Usage:
One can place the following configuration in their .vimrc to remove the trailing whitespaces on file write:
let g:strip_whitespaces_on_save = 1
Or one can manually invoke the script using the following keybinding:
<Leader>sw
If you don’t have a preferred installation method, I recommend using Vundle
With Vundle, you can simply add Bundle ‘notalex/vim-strip-trailers’ to your .vimrc and run
:BundleInstall