Last active
April 25, 2023 08:04
-
-
Save romainl/eabe0fe8c564da1b6cfe1826e1482536 to your computer and use it in GitHub Desktop.
Highlight characters after line 80
This file contains hidden or 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
augroup TooLong | |
autocmd! | |
autocmd winEnter,BufEnter * call clearmatches() | call matchadd('ColorColumn', '\%>80v', 100) | |
augroup END |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think you need the
eval()
, here. This should be enough:That said
set tw=0
means that there is no line length limit for that buffer so a better approach would probably be to wrap the whole thing in a conditional:&tw > 0
, highlight the characters aftertw
,&tw == 0
, don't highlight anything as it doesn't make sense in that context.