After watching Damian Conway's talk, I added the following two lines to my .vimrc
.
highlight ColorColumn ctermbg=magenta
call matchadd('ColorColumn', '\%81v', 100)
My objective is to get the 81st column to be highlighted whenever a line goes beyond 80 characters. Unfortunately, if I open a new file and type 80i-
, then I get highlighting on the 81st column even though there is no character there.
If I manually delete the 80th character and type it again, I sometimes get highlighting on the 81st column and sometimes don't. When I have 80 characters, I'd prefer not to have the 81st column highlighted.
How can I achieve this behavior?