commit 6e5a28359147bdb783ce3a07b9ba38b1284e9a36
parent e629ca4203b9c7f88fb956277ca4854e1c875879
Author: Chris Bracken <chris@bracken.jp>
Date: Sat, 6 Jul 2013 00:47:20 -0700
Use Spacehi instead of manually highlighting trailing whitespace
Diffstat:
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/.vimrc b/.vimrc
@@ -54,6 +54,11 @@ set sw=2
set softtabstop=2
set expandtab
+" Whitespace highlighting
+let g:spacehi_spacecolor="ctermbg=red guibg=red"
+let g:spacehi_tabcolor="ctermbg=red guibg=red"
+let g:spacehi_nbspcolor="ctermbg=red guibg=red"
+
" Colorscheme and syntax highlighting
if &t_Co > 2 || has("gui_running")
syntax on
@@ -67,16 +72,10 @@ if &t_Co > 2 || has("gui_running")
endif
if has("autocmd")
- " Highlight trailing whitespace
- highlight ExtraWhitespace ctermbg=red guibg=red
- au ColorScheme * highlight ExtraWhitespace guibg=red
- au BufEnter,InsertLeave * match ExtraWhitespace /\s\+$/
- au InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
-
" Highlight over-length lines
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
- au BufEnter,InsertLeave * 2match OverLength /\%81v.\+/
- au BufEnter,InsertLeave *.java 2match OverLength /\%101v.\+/
+ au BufEnter,InsertLeave * match OverLength /\%81v.\+/
+ au BufEnter,InsertLeave *.java match OverLength /\%101v.\+/
endif
endif