Skip to content

Instantly share code, notes, and snippets.

@basepi
Created May 26, 2011 17:19
Show Gist options
  • Save basepi/993544 to your computer and use it in GitHub Desktop.
Save basepi/993544 to your computer and use it in GitHub Desktop.
Pre-7.3 Vim Colorcolumn-like hack
" 80-character limit highlighting for vim <7.3 Replace colorcolumn commands with
" the following commands
" Highlight 78-80 in 'Search' color
au BufWinEnter * let w:m1=matchadd('Search', '\%<81v.\%>77v', -1)
" Highlight past column 80 in 'ErrorMsg' color
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
" Highlight only column 81 (when it has characters in it)
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%81v.\+', -1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment