Highlighting matches in Vim over an inverted pattern

╄→尐↘猪︶ㄣ 提交于 2020-01-14 09:47:30

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!