فهرست منبع

add highlighting of white space on leaving insert mode

Weiyi Lou 13 سال پیش
والد
کامیت
30497f9249
1فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 6 3
      vim/vimrc

+ 6 - 3
vim/vimrc

@@ -36,26 +36,29 @@ endif
 if has("autocmd")
     " Enable filetype specific features
     filetype plugin indent on
+
     " Clear existing autocmd
     autocmd!
+
     " When editing a file, always jump to the last cursor position
     autocmd BufReadPost *
     \ if line("'\"") > 0 && line ("'\"") <= line("$") |
     \   exe "normal! g'\"" |
     \ endif
 
+    " Any actions on startup
+    autocmd VimEnter * call StartUp()
+
     autocmd WinEnter * setlocal cursorline
     autocmd WinLeave * setlocal nocursorline
 
     " Show trailing white space
     autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
+    autocmd InsertLeave * match ExtraWhitespace /\s\+$/
 
     " Source the vimrc file after saving it
     autocmd bufwritepost .vimrc source $MYVIMRC
 
-    " A way to specify startup actions
-    autocmd VimEnter * call StartUp()
-
     " if the last window is NERDTree, then close Vim
     "autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
 else