Yakov Lerner wrote:
> On 9/18/06, Thomas Holder <[EMAIL PROTECTED]> wrote:
>> Peng Yu wrote:
>> > I'm writing some xml code in vim. In xml, there are some pair like
>> > <g> </g>. Would you please let me know how to pair them as "{" and
>> > "}" such that I can us % to visit them?
>>
>> source $VIMRUNTIME/macros/matchit.vim
>> let b:match_words = '<g>:</g>'
> 
> Hmm, the set of xml tags that I have is large and
> basically open-ended. Do you mean, there is no method
> to let plugin handle *any* <...> tag, automatically ?
> Isn't it unproductive to add manually each and every tag
> to b:match_words ?

Try this:

let b:match_words = '<\(\w\+\)\(\s[^>]*\)\?>:</\1>'

This pattern also allows attributes inside the opening tag after some
space (but not newline). You could figure this out yourself if you would
read the help file for this macro.

Regards,
  Thomas

Reply via email to