Closed tasmo closed 9 years ago
@tasmo You can add this in your after.vimrc
file:
fun! StripTrailingWhitespace()
" Don't strip on these filetypes
if &ft =~ 'markdown\|slim\|haml'
return
endif
%s/\s\+$//e
endfun
autocmd! BufWritePre
autocmd BufWritePre * call StripTrailingWhitespace()
That was quick. Many thanks!
You're welcome :)
I don't want to have removed my trailing whitespace automatically while saving. Sure I know many cases in which it is comfortable.
But for writing in Markdown (as an example) it is necessary to use two trailing blanks at a line to get a line break instead of using a paragraph.
I commented out the line for a quick solution but it should be swichable.