From these two questions:
Vim syntax coloring: How do I highlight long lines only?
I've extracted the following config for my .vimrc:
augroup vimrc_autocmds
autocmd BufEnter * highlight OverLength ctermbg=darkred ctermfg=whitee guibg=#FFD9D9
autocmd BufEnter * match OverLength /\%>80v.\+/
augroup END
This works fine for highlighting lines longer that 80 characters in vim, but when I open another tab of the same file using:
:tab split
the highlighting doesn't work in the new tab, only in the original one. How can I achieve the same effect for the new tab?