Skip to content

Instantly share code, notes, and snippets.

@jorabra
Last active December 20, 2015 20:49
Show Gist options
  • Save jorabra/6192711 to your computer and use it in GitHub Desktop.
Save jorabra/6192711 to your computer and use it in GitHub Desktop.
Vim colored margins
highlight ColorColumn ctermbg=235 guibg=#2c2d27
" In Vim >= 7.3, also highlight columns 100+
if exists('+colorcolumn')
" (I picked 120-320 because you have to provide an upper bound and 320 just
" covers a 1080p GVim window in Ubuntu Mono 11 font.)
let &colorcolumn="80,".join(range(100,320),",")
else
" fallback for Vim < v7.3
autocmd BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
endif
@jorabra
Copy link
Author

jorabra commented Aug 9, 2013

How it looks:
Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment