diff options
author | Agathe Porte <microjoe@microjoe.org> | 2020-05-06 14:03:07 +0200 |
---|---|---|
committer | Agathe Porte <microjoe@microjoe.org> | 2020-05-06 14:03:07 +0200 |
commit | 2d66bc71b936559d10fd9d299a9d022757da9f5f (patch) | |
tree | 83c4ea81ec79e8eac1d027fd042a26e315df3639 /plugin | |
download | whitespace.vim-2d66bc71b936559d10fd9d299a9d022757da9f5f.tar.gz whitespace.vim-2d66bc71b936559d10fd9d299a9d022757da9f5f.zip |
initial commit
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/whitespace.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/plugin/whitespace.vim b/plugin/whitespace.vim new file mode 100644 index 0000000..a084470 --- /dev/null +++ b/plugin/whitespace.vim @@ -0,0 +1,17 @@ +" 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() |