2008/10/23 Tony Mechelynck <[EMAIL PROTECTED]>:
>
> On 23/10/08 10:36, Robin Wood wrote:
>> 2008/10/22 Tony Mechelynck<[EMAIL PROTECTED]>:
>>> Matchit is not "breaking" anything, it "improves" % matching; however,
>>> to do that, it relies on a buffer-local variable b:match_words telling
>>> it what to match: just look up what that variable is set to in:
>>> - a Vim script,
>>> - an HTML file,
>>> - an XML file
>>> - a bash script
>>> - etc.
>>>
>>> The above autocommand "restores" matching of round, square and curly
>>> brackets for these 4 filetypes which don't set the matchit setting in
>>> their filetype-plugins. However even here there is a plus: with the
>>> above, and matchit loaded at startup, you won't anymore pair a bracket
>>> within a comment with its opposite outside a comment.
>>>
>>
>> if has('autocmd')
>>         augroup vimrclocal
>>         " match (:),[:],{:} in matchit for C, C++, CSS and javascript
>>                 au FileType c,cpp,css,javascript,php
>>                         \ let b:match_words =&matchpairs
>>         " you may have other autocommands, unrelated to the above.
>>         " Place them here.
>>         augroup END
>> endif
>>
>> I mainly edit .html and .php files so I added php to the FileType list
>> when adding this to my .vimrc. After this normal bracket matching
>> works for .php files  but I lose the html matching, html matching
>> works fine on .html files but no bracket matching.
>>
>> How do I view the buffer? I'll send in the entries from the different
>> file types.
>
> What do you mean by "view the buffer"? The file you're editing is in the
> active window. If you mean the autocommands for the FileType event,
>
>        :verbose au FileType
>
> will show them. You can optionally add an autocommand group name before
> the event name and/or an autocommand pattern after it. If you mean the
> b:match_words variable or the 'matchpairs' options for the current
> buffer, display them (after making sure that you edit the right buffer)
> by means of
>
>        :echo b:match_words
>        :verbose set matchpairs?

OK, from this, when editing a php file I get
 :echo b:match_words
(:),{:},[:]

and :verbose set matchpairs? gives
matchpairs=(:),{:},[:]

However, on my desktop with the latest vim when I do the echo I get this

<?php:?>,\<switch\>:\<endswitch\>,\<if\>:\<elseif\>:\<else\>:\<endif\>,\<while\>:\<endwhile\>,\<do\>:\<while\>,\<for\>:\<endfor\>,\<foreach\>:\<endforeach\>,(:),[:],{:},<:>,<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/
[ou]l>,<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,<\@<=\([^/][^
\t>]*\)[^>]*\%(>\|$\):<\@<=/\1>

This obviously explains the difference in how things work. Could it be
just the version of vim that is causing the problem or something else.

About the version, I know it is old, I know it needs updating, I know
there are bugs in it but I also know there is nothing I can do about
it. It isn't getting upgraded which is why I would like a fix for
this. If it isn't possible then as long as I know that it isn't I can
live with it but not knowing is very frustrating. Every other machine
I use has up-to-date versions, it is just this one machine.

Robin

>
> The ":verbose" prefix will make Vim display where the option was set (in
> Vim 7 it also works for mappings and autocommands).
>
>>
>> Re upgrading, it is a managed server and they will upgrade if I ask
>> for it but as it then becomes a non-standard setup and is no longer
>> supported. The version of vim is the least of my problems on that box!
>>
>> Robin
>
> Obsolete versions have an increasing number of known bugs, some of which
> can be very annoying. If you don't upgrade, then every time you think
> you've found a bug, please check the README lists for the patches (as
> listed in an earlier post of mine) to see if the bug you're about to
> report hasn't already been fixed.
>
> Also, the explanations, code snippets, etc., on this list often assume
> at least the "big" build of a "reasonably recent" patchlevel of the
> latest version of the Vim executable; if yours is older or less
> feature-rich, be sure to mention it in your question.
>
>
> Best regards,
> Tony.
> --
> hundred-and-one symptoms of being an internet addict:
> 221. Your wife melts your keyboard in the oven.
>
> >
>

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

Reply via email to