Quantcast

Getting matchit to work on html

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Getting matchit to work on html

Doug Carter-4

Hi all,

I changed distros and now I can't get matchit to work on html files.
I've spent hours on the net and in help files and have had no success.

Can someone send me some example .vimrc settings to get this working?

I'm currently running vim 6.3 on CentOS.

TIA,

Doug

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting matchit to work on html

A.J.Mechelynck
Doug Carter wrote:

> Hi all,
>
> I changed distros and now I can't get matchit to work on html files.
> I've spent hours on the net and in help files and have had no success.
>
> Can someone send me some example .vimrc settings to get this working?
>
> I'm currently running vim 6.3 on CentOS.
>
> TIA,
>
> Doug
>
>

"Normally" the following are enough (replace .vim by vimfiles and possibly
.vimrc by _vimrc on non-Unix-like platforms)

Notes:
1. I recommend upgrading to version 7.0 (current patchlevel is 7.0.162). In
that case the $VIMRUNTIME directory will of course be $VIM/vim70 instead of
$VIM/vim63. You might also get a newer version of matchit in the process:
current version is (AFAIK) version 1.11 dated May 15 10:00 PM 2006 EDT.
2. If $VIM is undefined in your shell (which is the normal case) replace it by
whatever it would be inside Vim (typically something like /usr/local/share/vim
on Unix, "C:\Program Files\vim" on Windows, etc.)

-----> ~/.vim/plugin/matchit.vim (full)
runtime macros/matchit.vim
<-----

-----> do this in the shell (once). I assume a Unix(-like) shell
-----> and Unix (or GNU) utilities.
mkdir -p ~/.vim/doc
cp -vf $VIM/vim63/macros/matchit.txt ~/.vim/doc
vim -u NONE -i NONE -N "+helptags ~/.vim/doc | q"
<-----

-----> .vimrc (partim)
set nocompatible
" comment out this 'if' block and its content
" to get menus & messages in your 'locale' language
if has("unix")
        language messages C
else
        language messages en
endif
runtime vimrc_example.vim
" the above sets (among others)
" filetype plugin indent on
" syntax on
" -------------------------------
" user customizations come here

<-----

If matchit still doesn't work after the above have been done, describe your
problem *in detail* with (if possible) precise steps to reproduce the problem,
what happened, and what should have happened, and send it to the vim-dev list
and/or to Benji Fischer (see email address near the top of
$VIMRUNTIME/macros/matchit.vim).



Best regards,
Tony.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting matchit to work on html

Doug Carter-4

Tony,

I have already corrected the problem (thanks to Paul Bolle who's on
this list).

The *only* thing I needed to do was add:

filetype plugin on

to my .vimrc file.

No copying files, creating directories, sourcing plugins, just this line.

I can't believe this isn't an FAQ. It's either my disto default settings
or there's not too many people using this functionality.

Thanks a lot for your complete explanation below. It's a good reference
for future configuration changes.

Best,

Doug


On Fri, Nov 10, 2006 at 05:44:00PM +0100, A.J.Mechelynck wrote:

> Doug Carter wrote:
> >Hi all,
> >
> >I changed distros and now I can't get matchit to work on html files.
> >I've spent hours on the net and in help files and have had no success.
> >
> >Can someone send me some example .vimrc settings to get this working?
> >
> >I'm currently running vim 6.3 on CentOS.
> >
> >TIA,
> >
> >Doug
> >
> >
>
> "Normally" the following are enough (replace .vim by vimfiles and possibly
> .vimrc by _vimrc on non-Unix-like platforms)
>
> Notes:
> 1. I recommend upgrading to version 7.0 (current patchlevel is 7.0.162). In
> that case the $VIMRUNTIME directory will of course be $VIM/vim70 instead of
> $VIM/vim63. You might also get a newer version of matchit in the process:
> current version is (AFAIK) version 1.11 dated May 15 10:00 PM 2006 EDT.
> 2. If $VIM is undefined in your shell (which is the normal case) replace it
> by whatever it would be inside Vim (typically something like
> /usr/local/share/vim on Unix, "C:\Program Files\vim" on Windows, etc.)
>
> -----> ~/.vim/plugin/matchit.vim (full)
> runtime macros/matchit.vim
> <-----
>
> -----> do this in the shell (once). I assume a Unix(-like) shell
> -----> and Unix (or GNU) utilities.
> mkdir -p ~/.vim/doc
> cp -vf $VIM/vim63/macros/matchit.txt ~/.vim/doc
> vim -u NONE -i NONE -N "+helptags ~/.vim/doc | q"
> <-----
>
> -----> .vimrc (partim)
> set nocompatible
> " comment out this 'if' block and its content
> " to get menus & messages in your 'locale' language
> if has("unix")
> language messages C
> else
> language messages en
> endif
> runtime vimrc_example.vim
> " the above sets (among others)
> " filetype plugin indent on
> " syntax on
> " -------------------------------
> " user customizations come here
>
> <-----
>
> If matchit still doesn't work after the above have been done, describe your
> problem *in detail* with (if possible) precise steps to reproduce the
> problem, what happened, and what should have happened, and send it to the
> vim-dev list and/or to Benji Fischer (see email address near the top of
> $VIMRUNTIME/macros/matchit.vim).
>
>
>
> Best regards,
> Tony.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting matchit to work on html

Paul Bolle
On Fri, 2006-11-10 at 09:35 -0800, Doug Carter wrote:

> I have already corrected the problem (thanks to Paul Bolle who's on
> this list).
>
> The *only* thing I needed to do was add:
>
> filetype plugin on
>
> to my .vimrc file.
>
> No copying files, creating directories, sourcing plugins, just this line.
>
> I can't believe this isn't an FAQ. It's either my distro default settings
> or there's not too many people using this functionality.

I once ran into the same problem on Fedora Core 4 (which probably has
the same default vim configuration as CentOS). Adding these lines
somewhere at the start of matchit.vim seems to do the trick (and can't
hurt those with a different configuration):

" load ftplugin if necessary
if !exists("did_load_ftplugin")
  filetype plugin on
  if !exists("did_load_ftplugin")
    finish
  endif
endif

(CC-ing Benji Fischer so Benji can consider adding a test like this to
matchit.)

Regards,


Paul Bolle

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting matchit to work on html

Benji Fisher
On Fri, Nov 10, 2006 at 09:07:18PM +0100, Paul Bolle wrote:

>
> I once ran into the same problem on Fedora Core 4 (which probably has
> the same default vim configuration as CentOS). Adding these lines
> somewhere at the start of matchit.vim seems to do the trick (and can't
> hurt those with a different configuration):
>
> " load ftplugin if necessary
> if !exists("did_load_ftplugin")
>   filetype plugin on
>   if !exists("did_load_ftplugin")
>     finish
>   endif
> endif
>
> (CC-ing Benji Fischer so Benji can consider adding a test like this to
> matchit.)
>
> Regards,
>
>
> Paul Bolle

     I do not like the idea of enabling ftplugins from within a (global)
plugin.  The

:filetype plugin [indent] on

line, like the

:set nocompatible

belongs in the user's vimrc file.  I know that several Linux distros
decide to do both of these (and more) from a system vimrc file, but I do
not like that decision.  If you have been using someone else's
configuration choices, and you decide to install vim from sources, you
can either read the docs and configure it yourself or you can continue
to let someone else decide with

:source $VIMRUNTIME/vimrc_example.vim

or

:runtime vimrc_example.vim

     I did add a note to the installation details at
http://www.vim.org/scripts/script.php?script_id=39 .
I could also add a note to doc/matchit.txt , but it seems unlikely that
anyone will know enough to install the documentation without also
knowing to enable ftplugins.

HTH --Benji Fisher
Loading...