From 5c6495c981f171566a28035314056e15a5e7968c Mon Sep 17 00:00:00 2001 From: nirenjan Date: Fri, 18 Jan 2013 14:18:31 -0800 Subject: [PATCH] Rework long-lines plugin to use colorcolumn This will always highlight characters that exceed the 80 character limit with ErrorMsg, but will also highlight the 81st column, so the user knows when to break. --- vim/plugin/long-lines.vim | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vim/plugin/long-lines.vim b/vim/plugin/long-lines.vim index edb8459..1e0c111 100644 --- a/vim/plugin/long-lines.vim +++ b/vim/plugin/long-lines.vim @@ -16,9 +16,11 @@ " NOTE: " This file will highlight all characters from column 81 onwards " -" Nirenjan Krishnan nirenjan@gmail.com 2008/12/16 +" Nirenjan Krishnan nirenjan@gmail.com 2013/01/19 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -match LineTooLong '\%>80v.\+' -highlight LineTooLong cterm=bold ctermbg=red guibg=LightYellow +if exists('+colorcolumn') + set colorcolumn=81 +endif +autocmd BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)