How pair <> in vim?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How pair <> in vim?

Peng Yu
Hi,

For the () pair and {} pair, I can use % to jump in between. However,
vim doesn't think < and > are a pair, which is heavily used in C++
templates. I'm wondering how to adjust vim's behavior such that I can
jump between < and >?

Thanks,
Peng
Reply | Threaded
Open this post in threaded view
|

RE: How pair <> in vim?

Max Dyckhoff
:set matchpairs+=<:>

That adds < and > as a pair to be matched by %, and also by the MatchParen script in vim 7.0.

Hope that helps!

Max

> -----Original Message-----
> From: Peng Yu [mailto:[hidden email]]
> Sent: Wednesday, September 13, 2006 5:41 PM
> To: [hidden email]
> Subject: How pair <> in vim?
>
> Hi,
>
> For the () pair and {} pair, I can use % to jump in between. However,
> vim doesn't think < and > are a pair, which is heavily used in C++
> templates. I'm wondering how to adjust vim's behavior such that I can
> jump between < and >?
>
> Thanks,
> Peng