On 12/02/09 12:51, Mahendra Ladhe wrote:
> Hi Tony,
> thanks for your answer. I installed matchit.vim plugin. It's working for
> the HTML tags,
> but not for the C code (example I gave in my original post).
> I sourced matchit.vim explicitly from vim(to rule out the possibility
> that it isn't getting sourced), still it didn't work for C code.
> What could be wrong? I'm using vim 7.1 on Windows XP.
>
> Thanks,
> Mahendra

Did you add the autocommand I mentioned? And did you add it sufficiently 
low in your vimrc? Without it, matchit won't work for C code.

Also, it might be time to upgrade to Vim 7.2. For 32-bit Windows, you 
can download a precompiled distribution (with all binaries, runtimes, 
etc.) from 
https://sourceforge.net/project/showfiles.php?group_id=43866&package_id=39721 
-- it is currently at patchlevel 7.2.101 there (since then, "only" 7 
additional patches have been published, see the last lines of 
http://ftp.vim.org/pub/vim/patches/7.2/README ).

You can see the ":version" listing for the gvim build included in that 
distribution (showig its featureset) before downloading, by clicking the 
clipboard-like icon next to the version number.


Best regards,
Tony.




>
> --- On *Wed, 11/2/09, Tony Mechelynck /<[email protected]>/*
> wrote:
>
>     From: Tony Mechelynck <[email protected]>
>     Subject: Re: Using % key to find matching brace: how to exclude
>     commented out code ?
>     To: [email protected]
>     Cc: [email protected]
>     Date: Wednesday, 11 February, 2009, 12:42 AM
>
>     On
>       10/02/09 12:32, Mahendra Ladhe wrote:
>     >  Hi,
>     >  when I use the '%' key to find matching brace('{' or
>     '}') in a C program,
>     >  vim includes the code which is commented out to find the matching 
> brace.
>     >  e.g.
>     >
>     >  1 #include<stdio.h>
>     >  2
>     >  3 int main(int argc, char* argv[])
>     >  4 {
>     >  5 int i=10;
>     >  6 /* } */
>     >  7 return 0;
>     >  8 }
>     >
>     >  If the cursor is on line 4 under '{' and I press the '%'
>     key, the cursor
>     >  shows
>     >  the matching closing brace on line 6 (which is commented out) and not
>     >  the matching
>     >  closing brace on line 8.
>     >
>     >  Is there any workaround for this?
>     >
>     >  Thanks,
>     >  Mahendra
>
>     Install the matchit plugin, see ":help matchit-install". (It
>     doesn't
>     match between inside and outside comments, and it can match much more
>     than single characters.) You may also, once you have installed it,
>       add
>
>       au FileType c,cpp,css,javascript
>               \ let b:match_words =&matchpairs
>
>     to your vimrc, in order to use matchit for these file types instead of
>     default matching, but with the same matches. (The ftplugins for many
>     filetypes set matchit settings if the matchit plugin is found to have
>     been loaded.)
>
>
>     Best regards,
>     Tony.
>     --
>       INVENTORY
>     Four be the things I am wiser to know:
>     Idleness, sorrow, a friend, and a foe.
>
>     Four be the things I'd been better without:
>     Love, curiosity, freckles, and doubt.
>
>     Three be the things I shall never attain:
>     Envy, content, and sufficient champagne.
>
>     Three be the things I shall have till I die:
>     Laughter and hope and a sock in the eye.
>
>
>
>
>     ------------------------------------------------------------------------
>       Explore your hobbies and interests.Click here to begin.  
> <http://in.rd.yahoo.com/tagline_groups_6/*http://in.promos.yahoo.com/groups/>
>
>     >
>
>
>


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to