This highlights the parts of the lines that are over 80 columns long:
augroup over_length
autocmd!
autocmd BufEnter * highlight OverLength ctermbg=darkgrey
autocmd BufEnter * match OverLength /\%80v.*/
augroup END
However, I would like to modify it to use &textwidth
. Using /\%.&textwidth.v.*/
doesn't seem to work. Is there a way to substitute the value into the regular expression?
set colorcolumn=80
. See:h 'cc'
colorcolumn
too distracting.