FG
💻 Software

Setting up multiple highlight rules in vim

Fresh5 days ago
Mar 15, 20265734 views
Confidence Score0%
0%

Problem

I am trying to set up rules to highlight both trailing whitespace and lines which are over a certain length by adding this to my .vimrc: However, it only seems to pick up whichever is last. I can't find a way to get them to both work simultaneously.

Error Output

highlight ExtraWhitespace ctermbg=lightgray guibg=lightgray
match ExtraWhitespace /\s\+$/

highlight OverLength ctermbg=lightgray guibg=lightgray
mat…

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Setting up multiple highlight rules in vim

Low Risk

One way: Another: Also available: . Up to three matches can be active at a time. Or you can use to create matches without limit to the quantity. Note: is used by matchparen, so will conflict if you use it.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment