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.
Written by Víðir Valberg Guðmundsson
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Related Tags
#vim
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#