Loading ...
Sorry, an error occurred while loading the content.
 

Re: new version of matchit.vim (for vim 6.0)

Expand Messages
  • Benoit Cerrina
    ... If ... it ... Great, now here is an updated ftplugin/vim.vim to include matchit definition for ruby (its not complete but it still helps a lot) the other
    Message 1 of 2 , Nov 1, 2001
      > 3. Allow b:match_words = "GetMyPattern()" for context-sensitive matching
      > patterns. (E.g., for imbedded languages, depending on current syntax.)
      If
      > b:match_words does not contain any ":" characters (and is non-empty) then
      it
      > is treated as an expression to be evaluated.
      >
      Great, now here is an updated ftplugin/vim.vim to include matchit definition
      for
      ruby (its not complete but it still helps a lot) the other scripting
      languages are
      left as an exercise for the reader or for me when I use them.
      Benoit
      PS:
      there is no matchit pattern for perl and tcl and that is surprising, on the
      other hand
      I doubt it can be done for python since it doesn't use patterns to recognize
      the end of
      a block but indent.
      PPS:
      I tried to add something in the ruby pattern for here documents but since
      backreference
      are not really supported but rather emulated it cannot be done I fear
    • Benji Fisher
      ... In fact, I was working on it tonight. If you want to help test the latest version (1.2) of matchit.vim for vim 6.0, you can get it from
      Message 2 of 2 , Nov 1, 2001
        Gary Johnson wrote:
        >
        > I believe this is a bug in matchit.vim. I observed similar behavior in
        > the matching of <>'s surrounding HTML tags. If you don't load
        > matchit.vim, vim deletes the matching } as expected. Benji is aware of
        > the bug and is supposed to be coming out with a new version of
        > matchit.vim real soon now.

        In fact, I was working on it tonight. If you want to help test the
        latest version (1.2) of matchit.vim for vim 6.0, you can get it from
        http://sites.netscape.net/BBenjiF/vim/plugin/matchit.vim
        (Warning: this URL is going to go away in a few weeks.)
        I have not yet updated the docs. (The old ones are in
        $VIMRUNTIME/macros/matchit.txt .)

        What it does: allow flexible configuration of "%" matching. Many
        languages are already supported.

        I made the following changes:

        1. Fix it so that matching works between "<" and ">" if "<:>" is included in
        'matchpairs' or b:match_words, even if "<tag>" is recognized as a matching
        pattern. (Background: this used to work, but was broken by a change in vim's
        handling of regular expressions.)

        2. Improve the behavior in Operator-pending mode. (By default, doing
        something complicated in O-mode is exclusive. We want the "%" motion to be
        inclusive.)

        3. Allow b:match_words = "GetMyPattern()" for context-sensitive matching
        patterns. (E.g., for imbedded languages, depending on current syntax.) If
        b:match_words does not contain any ":" characters (and is non-empty) then it
        is treated as an expression to be evaluated.

        4. Improve the handling of the (optional) b:match_ignorecase variable.

        The fixes for 1 and 3 were pretty easy, but the fix for 2 and 4 (which
        actually go together) was complicated, so further testing will be a good
        thing.

        --Benji Fisher
      Your message has been successfully submitted and would be delivered to recipients shortly.