如何用冒号突出显示搜索字符串的第二部分?(How to highlight second part of a search string with a colon?)
今天,我不得不问一些我无法通过反复试验解决的问题:
在vim中,我需要突出显示搜索字符串除以冒号后的第二个单词:
partA:partB
应该突出显示“partB”,并且应该搜索整个表达式。 我在我的系统中使用
!\zs\w\+\ze
,因此我尝试了这些额外的限制器。 目前我尝试过
\(solved:)(Yes\|No\|Almost\)\>
但我只想要“是”,“否”或“几乎突出显示”。 非常感谢。
Today I have to ask some of the problems I could not solve by trial and error:
In vim I need to highlight just the second word after a search string divided by a colon:
partA:partB
Just "partB" should be highlighted and the whole expression should be searched. I use
!\zs\w\+\ze
in my system and therefore I experimented with these additional limiters. At the moment I tried
\(solved:)(Yes\|No\|Almost\)\>
but I only want Yes, No or Almost highlighted. Thanks a lot.
原文:https://stackoverflow.com/questions/50929307