Hot tip for vim users: highlight spaces at end of lines
danlrobertson89 at gmail.com
Thu Dec 31 09:48:08 PST 2015
> You could also run that :substitute on :w and never have to worry about
> trailing whitespace ever again :)
> autocmd BufWritePre * :%s/\s\+$//e
Great tip! Just remember if you place a `autocmd` in your vimrc to place
it in a `augroup` and run `autocmd!`. Otherwise vim will create multiple
`autocmd`s for this each time vimrc is sourced. If I'm correct something
like the following will avoid that.
autocmd BufWritePre * :%s/\s\+$//e
Also for non-vim users, the git book has an incredible section on
configuring git to help with whitespace issues.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 473 bytes
Desc: Digital signature
More information about the LibreOffice