-
-
Save 0x8BADFOOD/da8abd26c8a2b4b0333e9f8f58fa2751 to your computer and use it in GitHub Desktop.
Highlight long lines (>80) and provide a toggle command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Highlight long lines (>80) | |
autocmd BufEnter * highlight OverLength ctermbg=darkgrey guibg=#592929 | |
autocmd BufEnter * match OverLength /\%81v.*/ | |
autocmd BufEnter * let w:long_line_match = 1 | |
fu! LongLineHighlightToggle() | |
highlight OverLength ctermbg=darkgrey guibg=#592929 | |
if exists('w:long_line_match') | |
match OverLength // | |
unlet w:long_line_match | |
else | |
match OverLength /\%81v.*/ | |
let w:long_line_match = 1 | |
endif | |
endfunction | |
map <Leader>l :call LongLineHighlightToggle()<CR> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment