From 0e5f4f3825a0f5a0a58b386f094f3a45b072d893 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 4 Aug 2009 17:14:12 +0200 Subject: [PATCH] only flag trailing spaces as errors when not inserting --- .vimrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.vimrc b/.vimrc index 27f219e..d9b3236 100644 --- a/.vimrc +++ b/.vimrc @@ -1453,11 +1453,16 @@ autocmd BufNewFile,BufRead /home/madduck/debian/pkg/logcheck/*/rulefiles/linux/* autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"zz" | endif " disable list mode when inserting stuff, otherwise keep it enabled, it's -" useful +" useful (see also setting lcs) augroup listinsert autocmd InsertEnter * set nolist autocmd InsertLeave * set list augroup end +" flag trailing spaces as error only when not inserting +augroup tsperrorinsert + autocmd InsertEnter * match none /\s\+$/ + autocmd InsertLeave * match Error /\s\+$/ +augroup end if &cp | set nocp | endif let s:cpo_save=&cpo @@ -1521,5 +1526,3 @@ source $HOME/.vim/macros/table.vim let g:SuperTabMappingForward = '' let g:SuperTabMappingBackward = '' - -match Error /\s\+$/ -- 2.39.5