1
0
mirror of https://github.com/bertptrs/vimconfig.git synced 2025-12-25 20:40:32 +01:00

Make sure significant whitespace is not trimmed.

This commit is contained in:
2018-11-09 12:17:01 +01:00
parent 996a50c5e5
commit bc71b80687

View File

@@ -47,7 +47,15 @@ autocmd Filetype markdown setlocal textwidth=72 expandtab
autocmd Filetype haskell setlocal expandtab autocmd Filetype haskell setlocal expandtab
" Remove trailing whitespace, always. " Remove trailing whitespace, always.
autocmd BufWritePre * :%s/\s\+$//e fun! StripTrailingWhitespace()
" Skip files where the type is trailing space sensitive.
if &ft =~ 'diff'
return
endif
%s/\s\+$//e
endfun
autocmd BufWritePre * call StripTrailingWhitespace()
" Keep backup files etc out of the way " Keep backup files etc out of the way
set undofile set undofile