On 24/10/08 00:55, Robin Wood wrote: > 2008/10/23 Tony Mechelynck<[EMAIL PROTECTED]>: >> On 24/10/08 00:24, Robin Wood wrote: >>> 2008/10/23 Tony Mechelynck<[EMAIL PROTECTED]>: >>>> On 23/10/08 23:11, Robin Wood wrote: >>>>> 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 >>>> Have you got matchit installed? Look at the output of ":scriptnames" and >>>> see if matchit is listed. If it isn't, then on Unix/Linux bash >>> Its there, number 9 >>> >>> 1: /etc/vimrc >>> 2: /usr/share/vim/vim63/syntax/syntax.vim >>> 3: /usr/share/vim/vim63/syntax/synload.vim >>> 4: /usr/share/vim/vim63/syntax/syncolor.vim >>> 5: /usr/share/vim/vim63/filetype.vim >>> 6: /home/robin/.vimrc >>> 7: /usr/share/vim/vim63/syntax/nosyntax.vim >>> 8: /usr/share/vim/vim63/ftplugin.vim >>> 9: /home/robin/.vim/plugin/matchit.vim >>> 10: /usr/share/vim/vim63/plugin/explorer.vim >>> 11: /usr/share/vim/vim63/plugin/gzip.vim >>> 12: /usr/share/vim/vim63/plugin/netrw.vim >>> 13: /usr/share/vim/vim63/plugin/rrhelper.vim >>> 14: /usr/share/vim/vim63/plugin/tohtml.vim >>> 15: /usr/share/vim/vim63/scripts.vim >>>> But then, if your ftplugins are not setting b:match_words it means >>>> you've got obsolete versions of the runtime files. >>> If this is the problem how can I fix it? >>> >>> Robin >> Hah! By getting more recent runtime files; but the current runtimes use >> the features of the corresponding current binaries, features some of >> which have probably been introduced since your current Vim version was >> published. Seems to me like a case of "have my cake and eat it too". >> > > So do you think downgrading matchit could fix it?
No I don't. I think upgrading ftplugin/*.vim might fix it, but in order for that to work you might have to upgrade the binary too. Best regards, Tony. -- hundred-and-one symptoms of being an internet addict: 222. You send more than 20 personal e-mails a day. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---