Chinaunix首页 | 论坛 | 博客
  • 博客访问: 749686
  • 博文数量: 176
  • 博客积分: 2548
  • 博客等级: 少校
  • 技术积分: 1749
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-29 16:36
个人简介

爱咋咋地

文章分类

全部博文(176)

文章存档

2024年(1)

2023年(17)

2022年(19)

2021年(3)

2020年(1)

2018年(1)

2017年(1)

2014年(1)

2013年(4)

2012年(11)

2011年(19)

2010年(22)

2009年(71)

2008年(5)

分类: LINUX

2010-06-30 11:20:42

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
阅读(4329) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~