" whitespace.vim - remove whitespaces on save if exists('g:loaded_whitespace') || &compatible finish else let g:loaded_whitespace = 1 endif fun! StripTrailingWhitespace() " Do not strip the whitespaces on these specific filetypes if &ft =~ 'markdown' return endif %s/\s\+$//e endfun au BufWritePre * call StripTrailingWhitespace()