Wikia

Vim Tips Wiki

Script:39

Talk0
1,613pages on
this wiki
Revision as of 09:41, January 11, 2012 by SanderTje! (Talk | contribs)

Use this page to discuss script 39 matchit: extended % matching

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

This appears to be the same plugin which is distributed with the official Vim runtime, in $VIMRUNTIME/macros/matchit.vim. See :help matchit-install.

Comments

It is very useful when edit the html file use vim to speed up the production effiency

Bug

Vim 6.3.82 is working fine, but Vim 7.0.237 couldn't work if not manually type in/source let b:match_words=...

Vim 7.0.237 is really old (though not quite as old as 6.3.82). Try upgrading. Vims 7.1, 7.2, and 7.3 all work fine with matchit.vim. --Fritzophrenic 15:22, February 21, 2011 (UTC)

Vim 7.3 : Matchit makes pressing % on ( or { or [ or ] or } or ) and other things not work in javascript files and files when there is <script>javascript code()</script>. Plugin is unstable and should not be used.

The first statement here, that matchit.vim breaks (, {, and [ is only partially true. I did just experiment and discovered that by default, pressing % on these has no effect. However, this is not a defect in the plugin itself. This is a misconfiguration of the b:match_words variable, which a simple glance at the help file for matchit.vim would have discovered. Adding the following to an after/ftplugin/html.vim file will "fix" the issue:
let b:match_words .= ',{:},(:),[:]'
Arguably, the default settings ought to contain these values, however I would hardly call the plugin "unstable" and recommend against using it because of something as trivial as this. The plugin is stable and useful enough to be included in the standard Vim installation's runtime. Always consult the help before assuming the behavior of a plugin or a Vim feature is a bug. --Fritzophrenic 14:29, July 1, 2011 (UTC)

Around Wikia's network

Random Wiki