Last Updated: February 25, 2016
·
409
· valberg

Remove trailing whitespace on save

Put the following in your .vimrc to remove whitespaces on save:

autocmd BufWritePre * :%s/\s\+$//e

Replace * with i.e. *.py to only affect certain filetypes.