commit 274c27355de4482679d6dd9fb9557393d69f8c07
parent fcfe6c82b8bd79fd398ebb06870f298a9463476c
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Fri, 21 Feb 2020 23:23:32 +0100
vim: strip trailing whitespace on save
Former-commit-id: 4a56e317e21ee06aed59d0b8409b5faadf1dd08b
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/vim/vimrc b/vim/vimrc
@@ -779,10 +779,14 @@ nnoremap <expr> <leader>mc g:loaded_dispatch ? ":Make clean<CR>" : ":silent make
" }}}
" Autocommands {{{
if has('autocmd')
- augroup sets
+ augroup vimrc_sets
autocmd!
autocmd InsertEnter * setlocal nocursorline
autocmd InsertLeave * setlocal cursorline
augroup END
+ augroup vimrc_commands
+ autocmd!
+ autocmd BufWritePre * silent StripTrailingWhitespace
+ augroup END
endif
" }}}