always highlight useless whitespaces in vim

This commit is contained in:
Morgan Wattiez 2019-06-23 11:00:54 +02:00
parent 614c6205dd
commit 54de52ad51

View File

@ -2,3 +2,9 @@ syntax on
set number set number
colorscheme desert colorscheme desert
set laststatus=2 set laststatus=2
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()