mirror of
https://github.com/bertptrs/vimconfig.git
synced 2025-12-25 12:30:32 +01:00
Make sure significant whitespace is not trimmed.
This commit is contained in:
@@ -47,7 +47,15 @@ autocmd Filetype markdown setlocal textwidth=72 expandtab
|
||||
autocmd Filetype haskell setlocal expandtab
|
||||
|
||||
" 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
|
||||
set undofile
|
||||
|
||||
Reference in New Issue
Block a user