Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 614159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:04:54+00:00 2026-05-13T18:04:54+00:00

The matchit plugin for vim is supposed to allow you to use the %

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T18:04:55+00:00Added an answer on May 13, 2026 at 6:04 pm

    Thanks to this posting from the vim_use mailing list, I found a sequence of commands that works:

    vim -u NONE somefile.html
    

    (this starts vim without reading .vimrc)

    Then,

    :set nocp
    :source /usr/share/vim/vim72/macros/matchit.vim
    :filetype plugin on
    :filetype detect
    :syntax on
    

    It’s not ideal, but it doesn’t seem to work from .vimrc. And it doesn’t work when syntax on precedes the filetype detection, so I suspect there’s a conflict in the interaction between the syntax highlighting stuff and matching stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.