Created
July 28, 2013 02:05
-
-
Save kyletolle/6097047 to your computer and use it in GitHub Desktop.
Highlight whitespace at the end of lines while using VIM.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
"Highlight whitespace at the end of lines | |
" From: http://vim.wikia.com/wiki/Highlight_unwanted_spaces | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment