Created
August 6, 2014 21:28
-
-
Save JessieAMorris/02d992f9fd363183c440 to your computer and use it in GitHub Desktop.
Highligh mixed tabs & spaces
This file contains 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 MixedIndent ctermbg = red guibg = #FF0000 | |
" Executes all auto commands | |
function! <SID>SetupAutoCommands() | |
" Auto commands group | |
augroup better_whitespace | |
autocmd! | |
" Highlight extraneous whitespace at the end of lines, but not the | |
" current line | |
syn clear MixedIndent | syn match MixedIndent excludenl /\v^\s*( \t|\t )\s*/ | |
autocmd InsertEnter * syn clear MixedIndent | syn match MixedIndent excludenl /\v^\s*( \t|\t )\s*\%#\@!/ containedin=ALL | |
autocmd InsertLeave,BufReadPost * syn clear MixedIndent | syn match MixedIndent excludenl /\v^\s*( \t|\t )\s*/ containedin=ALL | |
augroup END | |
endfunction | |
" Initial call to setup autocommands | |
call <SID>SetupAutoCommands() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment