Monday, August 13, 2012

Re: Install matchit

On Sun, 12 Aug 2012, Benji Fisher wrote:

> On Sun, Aug 12, 2012 at 10:12 AM, Tony Mechelynck wrote:
>
>> On 12/08/12 11:26, lilleskut wrote:
>>
>>> I have a problem installing the matchit plugin (for matching html
>>> tags) which comes with vim on debian.
>>>
>>> As far as I understand, all I have to do is ':so
>>> PATHTOMATCHIT/matchit.vim' and I should be able to match html tags
>>> with pressing '%' in vim.
>>>
>>> Is this installation procedure correct, or do I still need to do
>>> something in addition to get html tag matching?
>>>
>>> Also, there are two files matchit.vim in debian, one in
>>> '/usr/share/vim/addons/plugin'**, the other in
>>> '/usr/share/vim/vim73/macros/'
>>>
>>> Does it matter which one I chose? I tried with either, but without
>>> success, i.e. '%' did not have any effect when I am on html tags.
>>>
>>>
>> The one in macros is probably the original one which every vim user
>> gets, even when not on Debian, or indeed not on Linux. The one in
>> addons/plugin could be a Debian version.
>>
>> Try the following:
>>
>> 1. Create a file (and possibly its directories) with the name
>> ~/.vim/plugin/matchit.vim and the following contents:
>>
>> runtime macros/matchit.vim
>>
>> [...]
>
> If you typed PATHTOMATCHIT literally, it would not work. I usually
> recommend adding this to your vimrc file:
>
> source $VIMRUNTIME/macros/matchit.vim

This is roughly equivalent to Tony's suggestion of:

runtime macros/matchit.vim

:runtime is almost the same as using :source and prepending $VIMRUNTIME.
But, it has the benefit of searching all 'runtimepath' directories (not
just the system directories), which makes it possible to override
system-wide versions.

As a side benefit, it's shorter to type (which isn't important
in a .vimrc, but can be useful in one-off's).

--
Best,
Ben H

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: