问题
How may I highlight in Vim with the :match command the text that does not matches with the given pattern?
So, I want the opposite of:
:match myGroup /foo/
回答1:
Well, you could do something like:
:match myBaseHighlight /foo/
:2match myGroup /./
where myBaseHighlight is defined to be your default appearance -- white on black, or whatever. :match will override :2match, so everything other than /foo/ will get the myGroup highlight.
来源:https://stackoverflow.com/questions/773554/highlighting-matches-in-vim-over-an-inverted-pattern