Debugging matchit plugin in vim (under Cygwin)

Posted by system PAUSE on Stack Overflow See other posts from Stack Overflow or by system PAUSE
Published on 2009-09-17T17:42:50Z Indexed on 2010/03/28 0:13 UTC
Read the original article Hit count: 988

Filed under:
|
|
|

The "matchit" plugin for vim is supposed to allow you to use the % key to jump between matching start/end tags when editing HTML, as well as /* and */ comment delimiters when editing other kinds of code.

I've followed the exact instructions in ":help matchit", but % still doesn't work for me.

It seems silly to ask "Why doesn't this work?" so instead I'm asking How can I diagnose the problem? Pointers to references are welcome, but specific vim-plugin-debugging techniques are preferred.

Here is the ~/.vim directory:

$ ls -ltaGR ~/.vim
/cygdrive/y/.vim:
total 0
drwxr-xr-x 1 spause 0 Sep 17 13:20 ..
drwxr-xr-x 1 spause 0 Sep 16 13:59 doc
drwxr-xr-x 1 spause 0 Sep 16 13:58 .
drwxr-xr-x 1 spause 0 Sep 16 13:58 plugin

/cygdrive/y/.vim/doc:
total 24
-rw-r--r-- 1 spause  1961 Sep 16 13:59 tags
drwxr-xr-x 1 spause     0 Sep 16 13:59 .
-rw-r--r-- 1 spause 19303 Sep 16 13:58 matchit.txt
drwxr-xr-x 1 spause     0 Sep 16 13:58 ..

/cygdrive/y/.vim/plugin:
total 32
drwxr-xr-x 1 spause     0 Sep 16 13:58 ..
-rw-r--r-- 1 spause 30714 Sep 16 13:58 matchit.vim
drwxr-xr-x 1 spause     0 Sep 16 13:58 .

I am running vim 7.2 under Cygwin (installed Fall 2008). cygcheck shows:

1829k 2008/06/12 C:\cygwin\bin\cygwin1.dll
Cygwin DLL version info:
    DLL version: 1.5.25
    DLL epoch: 19
    DLL bad signal mask: 19005
    DLL old termios: 5
    DLL malloc env: 28
    API major: 0
    API minor: 156
    Shared data: 4
    DLL identifier: cygwin1
    Mount registry: 2
    Cygnus registry name: Cygnus Solutions
    Cygwin registry name: Cygwin
    Program options name: Program Options
    Cygwin mount registry name: mounts v2
    Cygdrive flags: cygdrive flags
    Cygdrive prefix: cygdrive prefix
    Cygdrive default prefix:
    Build date: Thu Jun 12 19:34:46 CEST 2008
    CVS tag: cr-0x5f1
    Shared id: cygwin1S4

In vim, :set shows:

--- Options ---
  autoindent          fileformat=dos      shiftwidth=3
  background=dark     filetype=html       syntax=html
  cedit=^F            scroll=24           tabstop=3
  expandtab           shelltemp           textmode
  viminfo='20,<50,s10,h

Notably, the syntax and filetype are both recognized as HTML. (The syntax colouring is just fine.)

If additional info is needed, please comment.

UPDATE:

Per answer by too much php:

After trying vim -V1, I had changed my .vimrc to include a line

set nocp

so the compatible option is not on.

:let loadad_matchit

loaded_matchit        #1

:set runtimepath?

runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim72,/usr/share/vim/vimfiles/after,~/.vim/after

(~ is /cygdrive/y)

Per answer by michael:

:scriptnames

  1: /cygdrive/y/.vimrc
  2: /usr/share/vim/vim72/syntax/syntax.vim
  3: /usr/share/vim/vim72/syntax/synload.vim
  4: /usr/share/vim/vim72/syntax/syncolor.vim
  5: /usr/share/vim/vim72/filetype.vim
  6: /usr/share/vim/vim72/colors/evening.vim
  7: /cygdrive/y/.vim/plugin/matchit.vim
  8: /cygdrive/y/.vim/plugin/python_match.vim
  9: /usr/share/vim/vim72/plugin/getscriptPlugin.vim
 10: /usr/share/vim/vim72/plugin/gzip.vim
 11: /usr/share/vim/vim72/plugin/matchparen.vim
 12: /usr/share/vim/vim72/plugin/netrwPlugin.vim
 13: /usr/share/vim/vim72/plugin/rrhelper.vim
 14: /usr/share/vim/vim72/plugin/spellfile.vim
 15: /usr/share/vim/vim72/plugin/tarPlugin.vim
 16: /usr/share/vim/vim72/plugin/tohtml.vim
 17: /usr/share/vim/vim72/plugin/vimballPlugin.vim
 18: /usr/share/vim/vim72/plugin/zipPlugin.vim
 19: /usr/share/vim/vim72/syntax/html.vim
 20: /usr/share/vim/vim72/syntax/javascript.vim
 21: /usr/share/vim/vim72/syntax/vb.vim
 22: /usr/share/vim/vim72/syntax/css.vim

Note that matchit.vim, html.vim, tohtml.vim, css.vim, and javascript.vim are all present.

:echo b:match_words

E121: Undefined variable: b:match_words
E15: Invalid expression: b:match_words

Hm, this looks highly relevant. I'm now looking through :help matchit-debug to find out how to fix b:match_words.

© Stack Overflow or respective owner

Related posts about vim

Related posts about ide