On 03/12/2011 03:32 AM, John Beckett wrote:
lucentjames wrote:
What I need to do is have some list of keyword group (keyword
that have special chararters eg / . ? [ ])and use VIM to mark
to different color.

Syntax rules can be used, or highlighting with matchad().

One approach would be to use this tip (it uses matchadd()):
http://vim.wikia.com/wiki/Highlight_multiple_words

Use :Hsample to show a sample of the hightlights, which you can
change by editing the supplied highlights.csv file.

Assuming you want the same highlights over several sessions, you
could put commands like these in a file (say my.vim):

Hi 7 alpha
Hi 8 beta
Hi 9 gamma.delta

In Vim, use this command to source (apply) the commands:

:so my.vim

The '.' in 'gamma.delta' matches any character. It's an easy way
of highlighting 'gamma delta' (with a space).

Hmmm, looking at the tip I see that I had forgotten about :Hsave
and :Hrestore which would be another way to save settings.

There is also the Mark-script (http://www.vim.org/scripts/script.php?script_id=2666), which let's you add highlights on-the-fly. You can then also jump from mark to mark (with <Leader>* and <Leader>/).

Jeroen


--
website: http://budts.be/ - twitter: @teranex
___________________________________
Registered Linux User #482240 - GetFirefox.com - ubuntu.com

--
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

Reply via email to