python vim 关键字高亮_转一封邮件,说明怎样在vim中使多个关键字高亮显示

On 30/05/08 05:50, googler wrote:

> On May 27, 7:49 pm, Tony Mechelynck

> wrote:

>> On 28/05/08 02:43, Tony Mechelynck wrote:

>>

>>

>>

>>

>>

>>> On 24/05/08 20:59, googler wrote:

>>>> I would like to search for a particular string, say "abcd" and have

>>>> their occurences colored with red. Next I would like to search for

>>>> another string, say "wxyz" and have their occurences colored with

>>>> another color, say yellow. After the second pattern is found, the

>>>> first pattern should still remain colored. How can this be done in

>>>> vim? Thanks.

>>> :help :match

>>> :help :2match

>>> :help :3match

>>> :help matchadd()

>>> :help matchdelete()

>>> :help clearmatches()

>>> Note: The latest search pattern is in "register slash", so you can use

>>> :match ^R/

>>> (where ^R means "hit Ctrl-R) to "remember" the currently highlighted

>>> search before doing a new search. (Similarly with :2match but beware

>>> that :3match is used by bracket matching).

>>> Best regards,

>>> Tony.

>> Oops! That should have been

>>

>> :match /^R//

>>

>> Best regards,

>> Tony.

>> --

>

> On doing :match /^R// , I get "E28: No such highlight group name: /

> abcd/". Is there anything else I need to set? Thanks.

Looks like I was low on black tea when I made these previous posts:

hypotheinaemia is one of the main causes of erroneous posts with me.

Well: between the ":match" command-name and the /pattern/ you need the

name of a highlight group. For the same colors as the current search

pattern use

:match Search /^R//

For a red abckground as when syntax errors are found, use

:match Error /^R//

etc.

To see all the highlight groups currently defined in your Vim session

and how they are colored, use

:hi

Best regards,

Tony.

--

DENNIS: Oh, very nice. King, eh! I expect you've got a palace and fine

clothes and courtiers and plenty of food. And how d'you get

that? By

exploiting the workers! By hanging on to outdated imperialist dogma

which perpetuates the social and economic differences in our

society!

"Monty Python and the Holy Grail" PYTHON (MONTY)

PICTURES LTD

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值