To show trailing whitespace in Vim, I use the following:
highlight whitespaceEOL term=reverse ctermbg=Grey guibg=Grey
match whitespaceEOL /\s\+\(\%#\)\@!$/
When I use the following match for long lines, the first match is lost:
augroup longLines
autocmd! filetype zsh,sh,python,vim,c,cpp :match ColorColumn /\%>80v.\+/
augroup END
Why is that happening?
:matchonly matches one pattern at a time.:2matchand:3matchexist for exactly this reason. Try this:Alternatively, you can implement this as
syntax. Try this: