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 8347187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:17:02+00:00 2026-06-09T07:17:02+00:00

I downloaded the Matchit plugin and used it on my HTML file. Everything worked

  • 0

I downloaded the Matchit plugin and used it on my HTML file. Everything worked as it was supposed to until I used it on my list.

<ol>
    <li id="link-1"><a href="http://www.reddit.com/">reddit</a></li>
    <li id="link-2"><a href="http://www.vim.org/">vim</a></li>
    <li id="link-3"><a href="http://www.w3schools.com/">w3schools</a></li>
</ol>

If the cursor is on the first o when I press tab the cursor jumps to the first list item instead of the closing ol. And when I’m on the l of the first list item the cursor jumps to the l of the next list item tag. But if I move the cursor over to the first a of the link tag and hit tab then Matchit works just fine and jumps to the closing tag. Matchit works for all tags but list items? How do I fix this behavior?

  • 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-06-09T07:17:06+00:00Added an answer on June 9, 2026 at 7:17 am

    For starter, matchit is distributed with Vim without being activated. You don’t need to download it, just follow the instructions at :help matchit-install.

    Matchit uses a buffer variable called b:match_words to define pairs of matching tags: open an HTML file and type echo b:match_words. The value, here, is:

    <:>,<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>
    

    If I understand :help matchit and these patterns correctly, the <\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l> part is where the “problem” is. Notice that the behaviour is the same for definition lists: instead of jumping to the end tag, matchit jumps to intermediary tags.

    I’d guess that pasting this in an HTML ftplugin and doing a bit of customizing would solve the problem.

    edit

    This line seems to completely resolve the issue:

    autocmd FileType html let b:match_words='<:>,<\@<=\([^/][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
    

    I’ve just removed the two totally unecessary pattern definitions for <ul|ol> and <dl>, leaving only the basic matches.

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

Sidebar

Related Questions

I downloaded GCC 4.5 from http://www.netgull.com/gcc/releases/gcc-4.5.0/ but when I try to setup / build
I downloaded the http://wiki.netbeans.org/Scala Scala IDE Netbeans Plugin, and it works great. I then
downloaded Windows XP SP3 ISO image from Microsoft.com here http://www.microsoft.com/en-us/download/details.aspx?id=25129 and I am using
I downloaded Mono software (http://xamarin.com/monoforandroid) and the samples from the xamarin website (http://samples.xamarin.com/Android). When
I downloaded HTTP::Daemon::SSL for Strawberry Perl 5.10 from CPAN and ran this example: use
I downloaded Firebird-1.5.6.5026-0_embed_win32.zip and copy the file fbembed.dll and firebird.msg and ib_util.dll near my
I downloaded a binary file that was compiled (a C program) using GCC 4.4.4
I downloaded around 1000 images from URLs to the iPhone file system, but I'd
I downloaded a KML file and tried to load it into my project, which
I downloaded the typewatch file from the github page, put it in my vendor/assets/javascripts

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.