Skip to content

Instantly share code, notes, and snippets.

@frankwiles
Created August 30, 2012 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankwiles/3531321 to your computer and use it in GitHub Desktop.
Save frankwiles/3531321 to your computer and use it in GitHub Desktop.
vim trailing whitespace
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