On 8/2/06, Jose Castro <[EMAIL PROTECTED]> wrote:
" Add new highlight combinations...
highlight WHITE_ON_RED    ctermfg=white  ctermbg=red
highlight RED_ON_YELLOW   ctermfg=red    ctermbg=yellow
highlight BLUE_ON_BLUE    ctermfg=blue   ctermbg=blue

function! BadRefs ()
     " Track "faux" references...
     match WHITE_ON_RED /_ref[ ]*[[{(]\|_ref[ ]*-[^>]/
endfunction
call BadRefs()

function! LongLines ()
     " Track lines over 78 characters...
     2match RED_ON_YELLOW /.\%>78v/
endfunction
call LongLines()

function! Tabs ()
     " Track tabs...
     3match BLUE_ON_BLUE /       /
endfunction
call Tabs()


Now, two questions:

1) Is seems the third match conflicts with the matching parens plugin;
is there any way to avoid this?

2) Is there a way for me to continue adding matches past the third?

One way to add matches is to use syntax-based matches.

They work differently from :match matches, though, because
they interfere with other syntax rules and they will not always
highlight things as :match does.

Out of your 3 examples, #3 (tabs) is good candidate for a
syntax-based match. Your examples #1 and  #2 probably won't
work with syntax-based match.

Talking about syntax-base matches, you don't put them into vimrc.

You put them into ~/.vim/after/syntax/xxx.vim where xxx is filetype name.
For example if your filetype is cpp, then puttting this
      :syntax match BLUE_ON_BLUE /\t/
into ~/.vim/after/syntax/cpp.vim will highlight tabs as you expect.

Yakov

Reply via email to