Skip to content

Instantly share code, notes, and snippets.

@kongo2002
Created March 27, 2010 18:37
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 kongo2002/346275 to your computer and use it in GitHub Desktop.
Save kongo2002/346275 to your computer and use it in GitHub Desktop.
" Gist: http://gist.github.com/346275
" ToggleLongLines() - toggle matching of long lines --------------------{{{2
function! ToggleLongLines()
if exists('*matchadd')
if !exists('w:long_match')
let len = (&tw <= 0 ? 80 : &tw)
let w:long_match = matchadd('ErrorMsg', '.\%>'.(len+1).'v', 0)
echo 'longlines'
else
call matchdelete(w:long_match)
unlet w:long_match
echo 'nolonglines'
endif
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment