Thursday, December 25, 2014

Re: how to display different color in vi

Hi John,

thanks for your help. I have tried several times, but always failed.

1. I first tried to set "abc" in my file to be red as:

:match abc /\<yellow\>/

the system seems to be idle and there is no response.

2. I checked help with "match" command and tried its example:

:highlight abc ctermbg=green guibg=green
:match abc /\<red\>/

still there is no reponse.

could you give me some timps? thanks.






在 2014年12月24日星期三UTC+8下午7时08分01秒,JohnBeckett写道:
> skyworld wrote:
> > normally I use gvim instead of vi. My question is for gvim is:
> > can i use different color to show diffent word? For example,
> > I would like to highlight word "red" with red and "yellow"
> > with color yellow in one document. Is this possible?
>
> The tip for that is:
> http://vim.wikia.com/wiki/Highlight_multiple_words
>
> It can be done manually to a limited extent. In the following,
> "Search" and "Error" are highlight groups that should be
> displayed by default with the ":highlight" command.
>
> :match Search /\<yellow\>/
> :2match Error /\<red\>/
>
> To switch highlighting off:
>
> :match none
> :2match none
>
> John

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: