I would like to highlight overlong lines in Vim
(like here: https://stackoverflow.com/a/235970/1329844) as well as trailing whitespace (like here: https://stackoverflow.com/a/4617156/1329844). However, whenever I use both highlights, only the last one is applied.
I have the following code in my .vimrc
:
highlight OverLength ctermbg=0 ctermfg=197
match OverLength /\%>80v.\+/
highlight ExtraWhitespace ctermbg=0
match ExtraWhitespace /\s\+$/
When I open a file, only trailing whitespace is highlighted. If I exchange the order of the two highlight/match pairs, only overlength lines are highlighted. What do I need to change so that both patterns are matched and highlighted?