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

Re: [PATCH]Add an option for matchparen to disable it in insert mode

Expand Messages
  • Fanhe Fanhed
    In a 1000+ lines file, typing in the clsoing parenthesis. eg. func(|) ... The cursor will go to blink or shake. So I prefer disable matchparen in insert mode.
    Message 1 of 19 , Apr 30, 2013
    • 0 Attachment
      In a 1000+ lines file, typing in the clsoing parenthesis. eg.
      func(|)
      | means the cursor, go to type.
      The cursor will go to blink or shake. So I prefer disable matchparen in insert mode.


      2013/4/30 Gary Johnson <garyjohn@...>
      On 2013-04-30, Fanhe Fanhed wrote:
      > matchparen plugin in CursorMoveI autocmd is too slow while typing.
      > So I wish disable it in insert mode.

      I don't understand.  I don't even notice a delay when I type the
      closing parenthesis and then more characters.  Typing after the
      closing parenthesis seems to cancel the highlighting of the matching
      open parenthesis.  What sort of delay are you observing?

      Regards,
      Gary

      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.



      --
      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
       
      ---
      You received this message because you are subscribed to the Google Groups "vim_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Gary Johnson
      ... That s odd. I created a 2000+ line file, moved the cursor to the 50% point, opened a new line and entered func() , then moved the cursor to between the
      Message 2 of 19 , Apr 30, 2013
      • 0 Attachment
        On 2013-04-30, Fanhe Fanhed wrote:
        > In a 1000+ lines file, typing in the clsoing parenthesis. eg.
        > func(|)
        > | means the cursor, go to type.
        > The cursor will go to blink or shake. So I prefer disable matchparen in insert
        > mode.

        That's odd. I created a 2000+ line file, moved the cursor to the
        50% point, opened a new line and entered "func()", then moved the
        cursor to between the two parentheses as you showed, and started
        typing. The opening parenthesis remained steadily highlighted--
        there was no flickering or shaking.

        I tried it with Vim 7.3.882, both vim and gvim, on a Fedora 14
        system.

        Regards,
        Gary

        --
        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • glts
        ... I don t think this has anything to do with something being slow ... I ve never had any performance issues with matchparen, and 1000 lines still isn t a big
        Message 3 of 19 , Apr 30, 2013
        • 0 Attachment
          On Tue, Apr 30, 2013 at 4:16 PM, Fanhe Fanhed <fanhed@...> wrote:
          > In a 1000+ lines file, typing in the clsoing parenthesis. eg.
          > func(|)
          > | means the cursor, go to type.
          > The cursor will go to blink or shake. So I prefer disable matchparen in
          > insert mode.

          I don't think this has anything to do with something being slow ... I've
          never had any performance issues with matchparen, and 1000 lines still
          isn't a big file.

          Isn't the "blinking" or "shaking" coming from your 'showmatch' setting?
          You can disable it with ":set noshowmatch".

          --
          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Fanhe Fanhed
          That s odd too. I just forget how to reproduce. I remember it occurs a year ago on my working pc. I turn off this feature and try to reproduce in furturn. Now
          Message 4 of 19 , Apr 30, 2013
          • 0 Attachment
            That's odd too. I just forget how to reproduce. I remember it occurs a year ago on my working pc.
            I turn off this feature and try to reproduce in furturn.
            Now just forget this...

            Regards,
            Fanhe


            2013/5/1 Gary Johnson <garyjohn@...>
            On 2013-04-30, Fanhe Fanhed wrote:
            > In a 1000+ lines file, typing in the clsoing parenthesis. eg.
            > func(|)
            > | means the cursor, go to type.
            > The cursor will go to blink or shake. So I prefer disable matchparen in insert
            > mode.

            That's odd.  I created a 2000+ line file, moved the cursor to the
            50% point, opened a new line and entered "func()", then moved the
            cursor to between the two parentheses as you showed, and started
            typing.  The opening parenthesis remained steadily highlighted--
            there was no flickering or shaking.

            I tried it with Vim 7.3.882, both vim and gvim, on a Fedora 14
            system.

            Regards,
            Gary

            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.



            --
            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
             
            ---
            You received this message because you are subscribed to the Google Groups "vim_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
             
             
          • Fanhe Fanhed
            I just reproduce. eg: edit tag.c of vim sorce code file, and go to 2000 line number, input the follow func(((((((((())))))))) , snekjglenlnsekgnel|) | means
            Message 5 of 19 , May 1 12:09 AM
            • 0 Attachment
              I just reproduce.
              eg: edit tag.c of vim sorce code file, and go to 2000 line number, input the follow
              func(((((((((())))))))) , snekjglenlnsekgnel|)

              '|' means the cursor. Then go to type.

              And type again after run :NoMatchParen.

              In fact, the reason is this sentence in matchparen.vim
              let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 300)

              300msec will delay screen refreshing.
              For example run this
              autocmd CursorMoveI * sleep 100m


              After this, the cursor is flickering and shaking when typing.

              So, I prefer disable all CursorMoveI autocmd include matchparen plugin, but is not a matter in CursorMove autocmd.

              2013/5/1 Fanhe Fanhed <fanhed@...>
              That's odd too. I just forget how to reproduce. I remember it occurs a year ago on my working pc.
              I turn off this feature and try to reproduce in furturn.
              Now just forget this...

              Regards,
              Fanhe


              2013/5/1 Gary Johnson <garyjohn@...>
              On 2013-04-30, Fanhe Fanhed wrote:
              > In a 1000+ lines file, typing in the clsoing parenthesis. eg.
              > func(|)
              > | means the cursor, go to type.
              > The cursor will go to blink or shake. So I prefer disable matchparen in insert
              > mode.

              That's odd.  I created a 2000+ line file, moved the cursor to the
              50% point, opened a new line and entered "func()", then moved the
              cursor to between the two parentheses as you showed, and started
              typing.  The opening parenthesis remained steadily highlighted--
              there was no flickering or shaking.

              I tried it with Vim 7.3.882, both vim and gvim, on a Fedora 14
              system.

              Regards,
              Gary

              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.




              --
              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
               
              ---
              You received this message because you are subscribed to the Google Groups "vim_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
               
               
            • Gary Johnson
              ... Highlights the leftmost parenthesis and the cursor smoothly. ... Cursor again highlighted smoothly, but of course no highlighting of the parenthesis. ...
              Message 6 of 19 , May 1 8:16 AM
              • 0 Attachment
                On 2013-05-01, Fanhe Fanhed wrote:
                > I just reproduce.
                > eg: edit tag.c of vim sorce code file, and go to 2000 line number, input the
                > follow
                > func(((((((((())))))))) , snekjglenlnsekgnel|)
                >
                > '|' means the cursor. Then go to type.

                Highlights the leftmost parenthesis and the cursor smoothly.

                > And type again after run :NoMatchParen.

                Cursor again highlighted smoothly, but of course no highlighting of
                the parenthesis.

                > In fact, the reason is this sentence in matchparen.vim
                > let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip, stopline, 300)
                >
                > 300msec will delay screen refreshing.
                > For example run this
                > autocmd CursorMoveI * sleep 100m
                >
                >
                > After this, the cursor is flickering and shaking when typing.

                Now I see the flickering and shaking of the cursor, but only when
                NoMatchParen has not been executed.

                > So, I prefer disable all CursorMoveI autocmd include matchparen plugin, but is
                > not a matter in CursorMove autocmd.

                So you're saying that it takes on the order of 100 ms for the
                matchparen.vim plugin's s:Highlight_Matching_Pair() function to
                execute on your machine?

                I can't reproduce the problem without the "sleep 100m", but I can
                see that on slower hardware your patch could be useful.

                Regards,
                Gary

                --
                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php

                ---
                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Bram Moolenaar
                ... I suppose this is because the syntax highlighting for the language is slow. Disabling it for all file types is a bit of a blunt instrument then. How about
                Message 7 of 19 , May 1 1:29 PM
                • 0 Attachment
                  Fanhe Fanhed wrote:

                  > matchparen plugin in CursorMoveI autocmd is too slow while typing. So I
                  > wish disable it in insert mode.

                  I suppose this is because the syntax highlighting for the language is
                  slow. Disabling it for all file types is a bit of a blunt instrument
                  then.

                  How about allowing the user to specify the filetypes for which
                  matchparen works in insert mode? While at it, might as well defined the
                  file types for which it works at all.


                  --
                  hundred-and-one symptoms of being an internet addict:
                  258. When you want to see your girlfriend, you surf to her homepage.

                  /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                  /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                  \\\ an exciting new programming language -- http://www.Zimbu.org ///
                  \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                  --
                  --
                  You received this message from the "vim_dev" maillist.
                  Do not top-post! Type your reply below the text you are replying to.
                  For more information, visit http://www.vim.org/maillist.php

                  ---
                  You received this message because you are subscribed to the Google Groups "vim_dev" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Ingo Karkat
                  ... Such a configuration is not trivial to implement (think of compound filetypes like c.doxygen ) and still not the most general. If all this configurability
                  Message 8 of 19 , May 1 11:56 PM
                  • 0 Attachment
                    On 01-May-2013 22:29 +0200, Bram Moolenaar wrote:

                    > Fanhe Fanhed wrote:
                    >
                    >> matchparen plugin in CursorMoveI autocmd is too slow while typing. So I
                    >> wish disable it in insert mode.
                    >
                    > I suppose this is because the syntax highlighting for the language is
                    > slow. Disabling it for all file types is a bit of a blunt instrument
                    > then.
                    >
                    > How about allowing the user to specify the filetypes for which
                    > matchparen works in insert mode? While at it, might as well defined the
                    > file types for which it works at all.

                    Such a configuration is not trivial to implement (think of compound
                    filetypes like "c.doxygen") and still not the most general. If all this
                    configurability really has to be there, I'd rather have the script
                    observe both buffer-local or global variables, like:

                    #v+
                    autocmd CursorMovedI *
                    \ if exists('b:matchparen_no_insertmode') |
                    \ if b:matchparen_no_insertmode |
                    \ return |
                    \ endif
                    \ elseif exists('g:matchparen_no_insertmode') &&
                    g:matchparen_no_insertmode |
                    \ return |
                    \ endif |
                    \ ...
                    #v-

                    This gets you the filetype-specific disabling (in a little more
                    roundabout way, by setting b:matchparen_no_insertmode in
                    ~/.vim/after/ftplugin/{filetype}.vim), and you can also disable manually
                    for the current buffer, for all buffers in a particular subdirectory /
                    of a certain file size / matching a certain pattern / etc.

                    I use this idiom in a couple of my plugins, and I've found it more
                    flexible than a list of configurable filetypes.

                    -- regards, ingo

                    --
                    --
                    You received this message from the "vim_dev" maillist.
                    Do not top-post! Type your reply below the text you are replying to.
                    For more information, visit http://www.vim.org/maillist.php

                    ---
                    You received this message because you are subscribed to the Google Groups "vim_dev" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Christian Brabandt
                    Hi Ingo! ... Excuse me for chiming in, but I find this construct rather ugly and unreadable. How about this instead: #v+ autocmd CursorMovedI * if get(b:,
                    Message 9 of 19 , May 2 12:11 AM
                    • 0 Attachment
                      Hi Ingo!

                      On Do, 02 Mai 2013, Ingo Karkat wrote:

                      > #v+
                      > autocmd CursorMovedI *
                      > \ if exists('b:matchparen_no_insertmode') |
                      > \ if b:matchparen_no_insertmode |
                      > \ return |
                      > \ endif
                      > \ elseif exists('g:matchparen_no_insertmode') &&
                      > g:matchparen_no_insertmode |
                      > \ return |
                      > \ endif |
                      > \ ...
                      > #v-

                      Excuse me for chiming in, but I find this construct rather ugly and
                      unreadable. How about this instead:

                      #v+
                      autocmd CursorMovedI *
                      \ if get(b:, 'matchparen_no_insertmode', 0) ||
                      \ get(g:, 'matchparen_no_insertmode', 0)
                      \ return |
                      \ endif |
                      \ ...
                      #v-

                      regards,
                      Christian
                      --
                      Es ist lange her, daß sich die menschliche Phantasie die Hölle
                      ausgemalt hat, aber erst durch ihre jüngst erworbenen Fertigkeiten ist
                      sie in die Lage versetzt worden, ihre einstigen Vorstellungen zu
                      verwirklichen.
                      -- Bertrand A. W. Russell

                      --
                      --
                      You received this message from the "vim_dev" maillist.
                      Do not top-post! Type your reply below the text you are replying to.
                      For more information, visit http://www.vim.org/maillist.php

                      ---
                      You received this message because you are subscribed to the Google Groups "vim_dev" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                      For more options, visit https://groups.google.com/groups/opt_out.
                    • Ingo Karkat
                      ... Hello Christian, I appreciate your critique. I would move the conditionals into the s:Highlight_Matching_Pair() function, too; I just wanted to show the
                      Message 10 of 19 , May 2 12:32 AM
                      • 0 Attachment
                        On 02-May-2013 09:11 +0200, Christian Brabandt wrote:

                        > Hi Ingo!
                        >
                        > On Do, 02 Mai 2013, Ingo Karkat wrote:
                        >
                        >> #v+
                        >> autocmd CursorMovedI *
                        >> \ if exists('b:matchparen_no_insertmode') |
                        >> \ if b:matchparen_no_insertmode |
                        >> \ return |
                        >> \ endif
                        >> \ elseif exists('g:matchparen_no_insertmode') &&
                        >> g:matchparen_no_insertmode |
                        >> \ return |
                        >> \ endif |
                        >> \ ...
                        >> #v-
                        >
                        > Excuse me for chiming in, but I find this construct rather ugly and
                        > unreadable. How about this instead:
                        >
                        > #v+
                        > autocmd CursorMovedI *
                        > \ if get(b:, 'matchparen_no_insertmode', 0) ||
                        > \ get(g:, 'matchparen_no_insertmode', 0)
                        > \ return |
                        > \ endif |
                        > \ ...
                        > #v-

                        Hello Christian,

                        I appreciate your critique. I would move the conditionals into the
                        s:Highlight_Matching_Pair() function, too; I just wanted to show the
                        algorithm with the minimal amount of additional context.

                        Your rewrite doesn't correctly capture the fact that the buffer-local
                        value takes precedence over the global one; when b:... is 0 and g:... is
                        1, insert-mode matching should be ON, whereas your code would :return
                        early. Though it may not make that much sense here, I think the
                        precedence should be the same as with the built-in global-local options.

                        -- regards, ingo

                        --
                        --
                        You received this message from the "vim_dev" maillist.
                        Do not top-post! Type your reply below the text you are replying to.
                        For more information, visit http://www.vim.org/maillist.php

                        ---
                        You received this message because you are subscribed to the Google Groups "vim_dev" group.
                        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                        For more options, visit https://groups.google.com/groups/opt_out.
                      • Bram Moolenaar
                        ... Agreed, using a buffer-local variable is better than trying to use a pattern to match filetypes. -- hundred-and-one symptoms of being an internet addict:
                        Message 11 of 19 , May 2 6:33 PM
                        • 0 Attachment
                          Ingo Karkat wrote:

                          > On 01-May-2013 22:29 +0200, Bram Moolenaar wrote:
                          >
                          > > Fanhe Fanhed wrote:
                          > >
                          > >> matchparen plugin in CursorMoveI autocmd is too slow while typing. So I
                          > >> wish disable it in insert mode.
                          > >
                          > > I suppose this is because the syntax highlighting for the language is
                          > > slow. Disabling it for all file types is a bit of a blunt instrument
                          > > then.
                          > >
                          > > How about allowing the user to specify the filetypes for which
                          > > matchparen works in insert mode? While at it, might as well defined the
                          > > file types for which it works at all.
                          >
                          > Such a configuration is not trivial to implement (think of compound
                          > filetypes like "c.doxygen") and still not the most general. If all this
                          > configurability really has to be there, I'd rather have the script
                          > observe both buffer-local or global variables, like:
                          >
                          > #v+
                          > autocmd CursorMovedI *
                          > \ if exists('b:matchparen_no_insertmode') |
                          > \ if b:matchparen_no_insertmode |
                          > \ return |
                          > \ endif
                          > \ elseif exists('g:matchparen_no_insertmode') &&
                          > g:matchparen_no_insertmode |
                          > \ return |
                          > \ endif |
                          > \ ...
                          > #v-
                          >
                          > This gets you the filetype-specific disabling (in a little more
                          > roundabout way, by setting b:matchparen_no_insertmode in
                          > ~/.vim/after/ftplugin/{filetype}.vim), and you can also disable manually
                          > for the current buffer, for all buffers in a particular subdirectory /
                          > of a certain file size / matching a certain pattern / etc.
                          >
                          > I use this idiom in a couple of my plugins, and I've found it more
                          > flexible than a list of configurable filetypes.

                          Agreed, using a buffer-local variable is better than trying to use a
                          pattern to match filetypes.

                          --
                          hundred-and-one symptoms of being an internet addict:
                          267. You get an extra phone line so you can get phone calls.

                          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                          \\\ an exciting new programming language -- http://www.Zimbu.org ///
                          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                          --
                          --
                          You received this message from the "vim_dev" maillist.
                          Do not top-post! Type your reply below the text you are replying to.
                          For more information, visit http://www.vim.org/maillist.php

                          ---
                          You received this message because you are subscribed to the Google Groups "vim_dev" group.
                          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                          For more options, visit https://groups.google.com/groups/opt_out.
                        • Fanhe Fanhed
                          Agreed too. So, Ingo, can you offer a full patch? And please offer a global way to disable matchparen in insert mode. Because I found I really not need it in
                          Message 12 of 19 , May 4 5:59 AM
                          • 0 Attachment
                            Agreed too.
                            So, Ingo, can you offer a full patch?
                            And please offer a global way to disable matchparen in insert mode. Because I found I really not need it in insert mode. :)


                            2013/5/3 Bram Moolenaar <Bram@...>

                            Ingo Karkat wrote:

                            > On 01-May-2013 22:29 +0200, Bram Moolenaar wrote:
                            >
                            > > Fanhe Fanhed wrote:
                            > >
                            > >> matchparen plugin in CursorMoveI autocmd is too slow while typing. So I
                            > >> wish disable it in insert mode.
                            > >
                            > > I suppose this is because the syntax highlighting for the language is
                            > > slow.  Disabling it for all file types is a bit of a blunt instrument
                            > > then.
                            > >
                            > > How about allowing the user to specify the filetypes for which
                            > > matchparen works in insert mode?  While at it, might as well defined the
                            > > file types for which it works at all.
                            >
                            > Such a configuration is not trivial to implement (think of compound
                            > filetypes like "c.doxygen") and still not the most general. If all this
                            > configurability really has to be there, I'd rather have the script
                            > observe both buffer-local or global variables, like:
                            >
                            > #v+
                            >     autocmd CursorMovedI *
                            >     \ if exists('b:matchparen_no_insertmode') |
                            >     \     if b:matchparen_no_insertmode |
                            >     \         return |
                            >     \     endif
                            >     \ elseif exists('g:matchparen_no_insertmode') &&
                            > g:matchparen_no_insertmode |
                            >     \     return |
                            >     \ endif |
                            >     \ ...
                            > #v-
                            >
                            > This gets you the filetype-specific disabling (in a little more
                            > roundabout way, by setting b:matchparen_no_insertmode in
                            > ~/.vim/after/ftplugin/{filetype}.vim), and you can also disable manually
                            > for the current buffer, for all buffers in a particular subdirectory /
                            > of a certain file size / matching a certain pattern / etc.
                            >
                            > I use this idiom in a couple of my plugins, and I've found it more
                            > flexible than a list of configurable filetypes.

                            Agreed, using a buffer-local variable is better than trying to use a
                            pattern to match filetypes.

                            --
                            hundred-and-one symptoms of being an internet addict:
                            267. You get an extra phone line so you can get phone calls.

                             /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
                            ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                            \\\  an exciting new programming language -- http://www.Zimbu.org        ///
                             \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

                            --
                            --
                            You received this message from the "vim_dev" maillist.
                            Do not top-post! Type your reply below the text you are replying to.
                            For more information, visit http://www.vim.org/maillist.php

                            ---
                            You received this message because you are subscribed to the Google Groups "vim_dev" group.
                            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                            For more options, visit https://groups.google.com/groups/opt_out.



                            --
                            --
                            You received this message from the "vim_dev" maillist.
                            Do not top-post! Type your reply below the text you are replying to.
                            For more information, visit http://www.vim.org/maillist.php
                             
                            ---
                            You received this message because you are subscribed to the Google Groups "vim_dev" group.
                            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                            For more options, visit https://groups.google.com/groups/opt_out.
                             
                             
                          • Ingo Karkat
                            ... After thinking some more about it, I ve come to the conclusion that all attempts so far step around the central issue: The maximum matchparen delay in
                            Message 13 of 19 , May 6 5:54 AM
                            • 0 Attachment
                              On 04-May-2013 14:59 +0200, Fanhe Fanhed wrote:

                              > Agreed too.
                              > So, Ingo, can you offer a full patch?
                              > And please offer a global way to disable matchparen in insert mode.
                              > Because I found I really not need it in insert mode. :)
                              >
                              >
                              > 2013/5/3 Bram Moolenaar <Bram@... <mailto:Bram@...>>
                              >
                              >
                              > Ingo Karkat wrote:
                              >
                              > > On 01-May-2013 22:29 +0200, Bram Moolenaar wrote:
                              > >
                              > > > Fanhe Fanhed wrote:
                              > > >
                              > > >> matchparen plugin in CursorMoveI autocmd is too slow while
                              > typing. So I
                              > > >> wish disable it in insert mode.
                              > > >
                              > > > I suppose this is because the syntax highlighting for the
                              > language is
                              > > > slow. Disabling it for all file types is a bit of a blunt
                              > instrument
                              > > > then.
                              > > >
                              > > > How about allowing the user to specify the filetypes for which
                              > > > matchparen works in insert mode? While at it, might as well
                              > defined the
                              > > > file types for which it works at all.
                              > >
                              > > Such a configuration is not trivial to implement (think of compound
                              > > filetypes like "c.doxygen") and still not the most general. If all
                              > this
                              > > configurability really has to be there, I'd rather have the script
                              > > observe both buffer-local or global variables, like:
                              > >
                              > > #v+
                              > > autocmd CursorMovedI *
                              > > \ if exists('b:matchparen_no_insertmode') |
                              > > \ if b:matchparen_no_insertmode |
                              > > \ return |
                              > > \ endif
                              > > \ elseif exists('g:matchparen_no_insertmode') &&
                              > > g:matchparen_no_insertmode |
                              > > \ return |
                              > > \ endif |
                              > > \ ...
                              > > #v-
                              > >
                              > > This gets you the filetype-specific disabling (in a little more
                              > > roundabout way, by setting b:matchparen_no_insertmode in
                              > > ~/.vim/after/ftplugin/{filetype}.vim), and you can also disable
                              > manually
                              > > for the current buffer, for all buffers in a particular subdirectory /
                              > > of a certain file size / matching a certain pattern / etc.
                              > >
                              > > I use this idiom in a couple of my plugins, and I've found it more
                              > > flexible than a list of configurable filetypes.
                              >
                              > Agreed, using a buffer-local variable is better than trying to use a
                              > pattern to match filetypes.

                              After thinking some more about it, I've come to the conclusion that all
                              attempts so far step around the central issue: The maximum matchparen
                              delay in insert mode is too large, so that it noticeably affects typing.
                              We shouldn't work around this, neither by globally disabling in insert
                              mode, nor through any of the proposed filetype- or buffer-local
                              configurations.

                              Instead, let's just reduce the maximum allowable delay in insert mode,
                              as this also is much simpler to do. The plugin contains a hard-coded
                              maximum of 300 ms; attached patch reduces that somewhat arbitrarily to a
                              fifth, hopefully unnoticeable 60 ms. This way, there's no need to
                              configure anything, and you still reap the benefits of matchparen in
                              most cases, even for problematic files / file types. This only leaves
                              out old Vim versions that don't have the {timeout} argument on
                              searchpairpos(), but as you're the first to raise this issue, it may not
                              be that widespread to bother.

                              -- regards, ingo

                              PS: Do not top-post! Type your reply below the text you are replying to.

                              --
                              --
                              You received this message from the "vim_dev" maillist.
                              Do not top-post! Type your reply below the text you are replying to.
                              For more information, visit http://www.vim.org/maillist.php

                              ---
                              You received this message because you are subscribed to the Google Groups "vim_dev" group.
                              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                              For more options, visit https://groups.google.com/groups/opt_out.
                            • Bram Moolenaar
                              ... Thanks, makes sense. So, how do we decide on the timeout? 300 msec is too much, 60 msec is OK? Perhaps we should make this time configurable. -- They now
                              Message 14 of 19 , May 6 8:11 PM
                              • 0 Attachment
                                Ingo Karkat wrote:

                                > On 04-May-2013 14:59 +0200, Fanhe Fanhed wrote:
                                >
                                > > Agreed too.
                                > > So, Ingo, can you offer a full patch?
                                > > And please offer a global way to disable matchparen in insert mode.
                                > > Because I found I really not need it in insert mode. :)
                                > >
                                > >
                                > > 2013/5/3 Bram Moolenaar <Bram@... <mailto:Bram@...>>
                                > >
                                > >
                                > > Ingo Karkat wrote:
                                > >
                                > > > On 01-May-2013 22:29 +0200, Bram Moolenaar wrote:
                                > > >
                                > > > > Fanhe Fanhed wrote:
                                > > > >
                                > > > >> matchparen plugin in CursorMoveI autocmd is too slow while
                                > > typing. So I
                                > > > >> wish disable it in insert mode.
                                > > > >
                                > > > > I suppose this is because the syntax highlighting for the
                                > > language is
                                > > > > slow. Disabling it for all file types is a bit of a blunt
                                > > instrument
                                > > > > then.
                                > > > >
                                > > > > How about allowing the user to specify the filetypes for which
                                > > > > matchparen works in insert mode? While at it, might as well
                                > > defined the
                                > > > > file types for which it works at all.
                                > > >
                                > > > Such a configuration is not trivial to implement (think of compound
                                > > > filetypes like "c.doxygen") and still not the most general. If all
                                > > this
                                > > > configurability really has to be there, I'd rather have the script
                                > > > observe both buffer-local or global variables, like:
                                > > >
                                > > > #v+
                                > > > autocmd CursorMovedI *
                                > > > \ if exists('b:matchparen_no_insertmode') |
                                > > > \ if b:matchparen_no_insertmode |
                                > > > \ return |
                                > > > \ endif
                                > > > \ elseif exists('g:matchparen_no_insertmode') &&
                                > > > g:matchparen_no_insertmode |
                                > > > \ return |
                                > > > \ endif |
                                > > > \ ...
                                > > > #v-
                                > > >
                                > > > This gets you the filetype-specific disabling (in a little more
                                > > > roundabout way, by setting b:matchparen_no_insertmode in
                                > > > ~/.vim/after/ftplugin/{filetype}.vim), and you can also disable
                                > > manually
                                > > > for the current buffer, for all buffers in a particular subdirectory /
                                > > > of a certain file size / matching a certain pattern / etc.
                                > > >
                                > > > I use this idiom in a couple of my plugins, and I've found it more
                                > > > flexible than a list of configurable filetypes.
                                > >
                                > > Agreed, using a buffer-local variable is better than trying to use a
                                > > pattern to match filetypes.
                                >
                                > After thinking some more about it, I've come to the conclusion that all
                                > attempts so far step around the central issue: The maximum matchparen
                                > delay in insert mode is too large, so that it noticeably affects typing.
                                > We shouldn't work around this, neither by globally disabling in insert
                                > mode, nor through any of the proposed filetype- or buffer-local
                                > configurations.
                                >
                                > Instead, let's just reduce the maximum allowable delay in insert mode,
                                > as this also is much simpler to do. The plugin contains a hard-coded
                                > maximum of 300 ms; attached patch reduces that somewhat arbitrarily to a
                                > fifth, hopefully unnoticeable 60 ms. This way, there's no need to
                                > configure anything, and you still reap the benefits of matchparen in
                                > most cases, even for problematic files / file types. This only leaves
                                > out old Vim versions that don't have the {timeout} argument on
                                > searchpairpos(), but as you're the first to raise this issue, it may not
                                > be that widespread to bother.

                                Thanks, makes sense.

                                So, how do we decide on the timeout? 300 msec is too much, 60 msec is
                                OK? Perhaps we should make this time configurable.


                                --
                                They now pass three KNIGHTS impaled to a tree. With their feet off the
                                ground, with one lance through the lot of them, they are skewered up
                                like a barbecue.
                                "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                                /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                                \\\ an exciting new programming language -- http://www.Zimbu.org ///
                                \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                                --
                                --
                                You received this message from the "vim_dev" maillist.
                                Do not top-post! Type your reply below the text you are replying to.
                                For more information, visit http://www.vim.org/maillist.php

                                ---
                                You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                For more options, visit https://groups.google.com/groups/opt_out.
                              • Ingo Karkat
                                ... If Fanhe agrees with the proposed change, I d rather not make it more complex so far. Although I m usually a big proponent of configurability, the values
                                Message 15 of 19 , May 7 1:27 AM
                                • 0 Attachment
                                  On 07-May-2013 05:11 +0200, Bram Moolenaar wrote:

                                  > Ingo Karkat wrote:
                                  >
                                  >> On 04-May-2013 14:59 +0200, Fanhe Fanhed wrote:
                                  >>
                                  >>> Agreed too.
                                  >>> So, Ingo, can you offer a full patch?
                                  >>> And please offer a global way to disable matchparen in insert mode.
                                  >>> Because I found I really not need it in insert mode. :)
                                  >>>
                                  >>>
                                  >>> 2013/5/3 Bram Moolenaar <Bram@... <mailto:Bram@...>>
                                  >>>
                                  >>>
                                  >>> Ingo Karkat wrote:
                                  >>>
                                  >>> > On 01-May-2013 22:29 +0200, Bram Moolenaar wrote:
                                  >>> >
                                  >>> > > Fanhe Fanhed wrote:
                                  >>> > >
                                  >>> > >> matchparen plugin in CursorMoveI autocmd is too slow while
                                  >>> typing. So I
                                  >>> > >> wish disable it in insert mode.
                                  >>> > >
                                  >>> > > I suppose this is because the syntax highlighting for the
                                  >>> language is
                                  >>> > > slow. Disabling it for all file types is a bit of a blunt
                                  >>> instrument
                                  >>> > > then.
                                  >>> > >
                                  >>> > > How about allowing the user to specify the filetypes for which
                                  >>> > > matchparen works in insert mode? While at it, might as well
                                  >>> defined the
                                  >>> > > file types for which it works at all.
                                  >>> >
                                  >>> > Such a configuration is not trivial to implement (think of compound
                                  >>> > filetypes like "c.doxygen") and still not the most general. If all
                                  >>> this
                                  >>> > configurability really has to be there, I'd rather have the script
                                  >>> > observe both buffer-local or global variables, like:
                                  >>> >
                                  >>> > #v+
                                  >>> > autocmd CursorMovedI *
                                  >>> > \ if exists('b:matchparen_no_insertmode') |
                                  >>> > \ if b:matchparen_no_insertmode |
                                  >>> > \ return |
                                  >>> > \ endif
                                  >>> > \ elseif exists('g:matchparen_no_insertmode') &&
                                  >>> > g:matchparen_no_insertmode |
                                  >>> > \ return |
                                  >>> > \ endif |
                                  >>> > \ ...
                                  >>> > #v-
                                  >>> >
                                  >>> > This gets you the filetype-specific disabling (in a little more
                                  >>> > roundabout way, by setting b:matchparen_no_insertmode in
                                  >>> > ~/.vim/after/ftplugin/{filetype}.vim), and you can also disable
                                  >>> manually
                                  >>> > for the current buffer, for all buffers in a particular subdirectory /
                                  >>> > of a certain file size / matching a certain pattern / etc.
                                  >>> >
                                  >>> > I use this idiom in a couple of my plugins, and I've found it more
                                  >>> > flexible than a list of configurable filetypes.
                                  >>>
                                  >>> Agreed, using a buffer-local variable is better than trying to use a
                                  >>> pattern to match filetypes.
                                  >>
                                  >> After thinking some more about it, I've come to the conclusion that all
                                  >> attempts so far step around the central issue: The maximum matchparen
                                  >> delay in insert mode is too large, so that it noticeably affects typing.
                                  >> We shouldn't work around this, neither by globally disabling in insert
                                  >> mode, nor through any of the proposed filetype- or buffer-local
                                  >> configurations.
                                  >>
                                  >> Instead, let's just reduce the maximum allowable delay in insert mode,
                                  >> as this also is much simpler to do. The plugin contains a hard-coded
                                  >> maximum of 300 ms; attached patch reduces that somewhat arbitrarily to a
                                  >> fifth, hopefully unnoticeable 60 ms. This way, there's no need to
                                  >> configure anything, and you still reap the benefits of matchparen in
                                  >> most cases, even for problematic files / file types. This only leaves
                                  >> out old Vim versions that don't have the {timeout} argument on
                                  >> searchpairpos(), but as you're the first to raise this issue, it may not
                                  >> be that widespread to bother.
                                  >
                                  > Thanks, makes sense.
                                  >
                                  > So, how do we decide on the timeout? 300 msec is too much, 60 msec is
                                  > OK? Perhaps we should make this time configurable.

                                  If Fanhe agrees with the proposed change, I'd rather not make it more
                                  complex so far. Although I'm usually a big proponent of configurability,
                                  the values seem to be fine for 99,99% of users, and a maximum, corner
                                  case delay of 1/3 s while moving around seems as reasonable as a barely
                                  noticeable 60 ms while typing.

                                  -- regards, ingo

                                  --
                                  --
                                  You received this message from the "vim_dev" maillist.
                                  Do not top-post! Type your reply below the text you are replying to.
                                  For more information, visit http://www.vim.org/maillist.php

                                  ---
                                  You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                  For more options, visit https://groups.google.com/groups/opt_out.
                                • Bram Moolenaar
                                  ... It s not so complicated: if !exists( g:matchparen_timeout ) let g:matchparen_timeout = 300 endif if !exists( g:matchparen_insert_timeout ) let
                                  Message 16 of 19 , May 7 8:22 PM
                                  • 0 Attachment
                                    > Ingo Karkat wrote:
                                    >
                                    > >> On 04-May-2013 14:59 +0200, Fanhe Fanhed wrote:
                                    > >>
                                    > >>> Agreed too.
                                    > >>> So, Ingo, can you offer a full patch?
                                    > >>> And please offer a global way to disable matchparen in insert mode.
                                    > >>> Because I found I really not need it in insert mode. :)
                                    > >>>
                                    > >>>
                                    > >>> 2013/5/3 Bram Moolenaar <Bram@... <mailto:Bram@...>>
                                    > >>>
                                    > >>>
                                    > >>> Ingo Karkat wrote:
                                    > >>>
                                    > >>> > On 01-May-2013 22:29 +0200, Bram Moolenaar wrote:
                                    > >>> >
                                    > >>> > > Fanhe Fanhed wrote:
                                    > >>> > >
                                    > >>> > >> matchparen plugin in CursorMoveI autocmd is too slow while
                                    > >>> typing. So I
                                    > >>> > >> wish disable it in insert mode.
                                    > >>> > >
                                    > >>> > > I suppose this is because the syntax highlighting for the
                                    > >>> language is
                                    > >>> > > slow. Disabling it for all file types is a bit of a blunt
                                    > >>> instrument
                                    > >>> > > then.
                                    > >>> > >
                                    > >>> > > How about allowing the user to specify the filetypes for which
                                    > >>> > > matchparen works in insert mode? While at it, might as well
                                    > >>> defined the
                                    > >>> > > file types for which it works at all.
                                    > >>> >
                                    > >>> > Such a configuration is not trivial to implement (think of compound
                                    > >>> > filetypes like "c.doxygen") and still not the most general. If all
                                    > >>> this
                                    > >>> > configurability really has to be there, I'd rather have the script
                                    > >>> > observe both buffer-local or global variables, like:
                                    > >>> >
                                    > >>> > #v+
                                    > >>> > autocmd CursorMovedI *
                                    > >>> > \ if exists('b:matchparen_no_insertmode') |
                                    > >>> > \ if b:matchparen_no_insertmode |
                                    > >>> > \ return |
                                    > >>> > \ endif
                                    > >>> > \ elseif exists('g:matchparen_no_insertmode') &&
                                    > >>> > g:matchparen_no_insertmode |
                                    > >>> > \ return |
                                    > >>> > \ endif |
                                    > >>> > \ ...
                                    > >>> > #v-
                                    > >>> >
                                    > >>> > This gets you the filetype-specific disabling (in a little more
                                    > >>> > roundabout way, by setting b:matchparen_no_insertmode in
                                    > >>> > ~/.vim/after/ftplugin/{filetype}.vim), and you can also disable
                                    > >>> manually
                                    > >>> > for the current buffer, for all buffers in a particular subdirectory /
                                    > >>> > of a certain file size / matching a certain pattern / etc.
                                    > >>> >
                                    > >>> > I use this idiom in a couple of my plugins, and I've found it more
                                    > >>> > flexible than a list of configurable filetypes.
                                    > >>>
                                    > >>> Agreed, using a buffer-local variable is better than trying to use a
                                    > >>> pattern to match filetypes.
                                    > >>
                                    > >> After thinking some more about it, I've come to the conclusion that all
                                    > >> attempts so far step around the central issue: The maximum matchparen
                                    > >> delay in insert mode is too large, so that it noticeably affects typing.
                                    > >> We shouldn't work around this, neither by globally disabling in insert
                                    > >> mode, nor through any of the proposed filetype- or buffer-local
                                    > >> configurations.
                                    > >>
                                    > >> Instead, let's just reduce the maximum allowable delay in insert mode,
                                    > >> as this also is much simpler to do. The plugin contains a hard-coded
                                    > >> maximum of 300 ms; attached patch reduces that somewhat arbitrarily to a
                                    > >> fifth, hopefully unnoticeable 60 ms. This way, there's no need to
                                    > >> configure anything, and you still reap the benefits of matchparen in
                                    > >> most cases, even for problematic files / file types. This only leaves
                                    > >> out old Vim versions that don't have the {timeout} argument on
                                    > >> searchpairpos(), but as you're the first to raise this issue, it may not
                                    > >> be that widespread to bother.
                                    > >
                                    > > Thanks, makes sense.
                                    > >
                                    > > So, how do we decide on the timeout? 300 msec is too much, 60 msec is
                                    > > OK? Perhaps we should make this time configurable.
                                    >
                                    > If Fanhe agrees with the proposed change, I'd rather not make it more
                                    > complex so far. Although I'm usually a big proponent of configurability,
                                    > the values seem to be fine for 99,99% of users, and a maximum, corner
                                    > case delay of 1/3 s while moving around seems as reasonable as a barely
                                    > noticeable 60 ms while typing.

                                    It's not so complicated:

                                    if !exists("g:matchparen_timeout")
                                    let g:matchparen_timeout = 300
                                    endif
                                    if !exists("g:matchparen_insert_timeout")
                                    let g:matchparen_insert_timeout = 60
                                    endif

                                    ...


                                    if mode() == 'i' || mode() == 'R'
                                    let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
                                    else
                                    let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
                                    endif

                                    --
                                    ZOOT: I'm afraid our life must seem very dull and quiet compared to yours.
                                    We are but eightscore young blondes, all between sixteen and
                                    nineteen-and-a-half, cut off in this castle, with no one to protect us.
                                    Oooh. It is a lonely life ... bathing ... dressing ... undressing ...
                                    making exciting underwear....
                                    "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                    /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                                    /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                                    \\\ an exciting new programming language -- http://www.Zimbu.org ///
                                    \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                                    --
                                    --
                                    You received this message from the "vim_dev" maillist.
                                    Do not top-post! Type your reply below the text you are replying to.
                                    For more information, visit http://www.vim.org/maillist.php

                                    ---
                                    You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                    For more options, visit https://groups.google.com/groups/opt_out.
                                  • Fanhe Fanhed
                                    Agree with Bram. Thanks all. 2013/5/8 Bram Moolenaar ... -- -- You received this message from the vim_dev maillist. Do not top-post!
                                    Message 17 of 19 , May 13 7:03 AM
                                    • 0 Attachment
                                      Agree with Bram.
                                      Thanks all.


                                      2013/5/8 Bram Moolenaar <Bram@...>

                                      > Ingo Karkat wrote:
                                      >
                                      > >> On 04-May-2013 14:59 +0200, Fanhe Fanhed wrote:
                                      > >>
                                      > >>> Agreed too.
                                      > >>> So, Ingo, can you offer a full patch?
                                      > >>> And please offer a global way to disable matchparen in insert mode.
                                      > >>> Because I found I really not need it in insert mode. :)
                                      > >>>
                                      > >>>
                                      > >>> 2013/5/3 Bram Moolenaar <Bram@... <mailto:Bram@...>>
                                      > >>>
                                      > >>>
                                      > >>>     Ingo Karkat wrote:
                                      > >>>
                                      > >>>     > On 01-May-2013 22:29 +0200, Bram Moolenaar wrote:
                                      > >>>     >
                                      > >>>     > > Fanhe Fanhed wrote:
                                      > >>>     > >
                                      > >>>     > >> matchparen plugin in CursorMoveI autocmd is too slow while
                                      > >>>     typing. So I
                                      > >>>     > >> wish disable it in insert mode.
                                      > >>>     > >
                                      > >>>     > > I suppose this is because the syntax highlighting for the
                                      > >>>     language is
                                      > >>>     > > slow.  Disabling it for all file types is a bit of a blunt
                                      > >>>     instrument
                                      > >>>     > > then.
                                      > >>>     > >
                                      > >>>     > > How about allowing the user to specify the filetypes for which
                                      > >>>     > > matchparen works in insert mode?  While at it, might as well
                                      > >>>     defined the
                                      > >>>     > > file types for which it works at all.
                                      > >>>     >
                                      > >>>     > Such a configuration is not trivial to implement (think of compound
                                      > >>>     > filetypes like "c.doxygen") and still not the most general. If all
                                      > >>>     this
                                      > >>>     > configurability really has to be there, I'd rather have the script
                                      > >>>     > observe both buffer-local or global variables, like:
                                      > >>>     >
                                      > >>>     > #v+
                                      > >>>     >     autocmd CursorMovedI *
                                      > >>>     >     \ if exists('b:matchparen_no_insertmode') |
                                      > >>>     >     \     if b:matchparen_no_insertmode |
                                      > >>>     >     \         return |
                                      > >>>     >     \     endif
                                      > >>>     >     \ elseif exists('g:matchparen_no_insertmode') &&
                                      > >>>     > g:matchparen_no_insertmode |
                                      > >>>     >     \     return |
                                      > >>>     >     \ endif |
                                      > >>>     >     \ ...
                                      > >>>     > #v-
                                      > >>>     >
                                      > >>>     > This gets you the filetype-specific disabling (in a little more
                                      > >>>     > roundabout way, by setting b:matchparen_no_insertmode in
                                      > >>>     > ~/.vim/after/ftplugin/{filetype}.vim), and you can also disable
                                      > >>>     manually
                                      > >>>     > for the current buffer, for all buffers in a particular subdirectory /
                                      > >>>     > of a certain file size / matching a certain pattern / etc.
                                      > >>>     >
                                      > >>>     > I use this idiom in a couple of my plugins, and I've found it more
                                      > >>>     > flexible than a list of configurable filetypes.
                                      > >>>
                                      > >>>     Agreed, using a buffer-local variable is better than trying to use a
                                      > >>>     pattern to match filetypes.
                                      > >>
                                      > >> After thinking some more about it, I've come to the conclusion that all
                                      > >> attempts so far step around the central issue: The maximum matchparen
                                      > >> delay in insert mode is too large, so that it noticeably affects typing.
                                      > >> We shouldn't work around this, neither by globally disabling in insert
                                      > >> mode, nor through any of the proposed filetype- or buffer-local
                                      > >> configurations.
                                      > >>
                                      > >> Instead, let's just reduce the maximum allowable delay in insert mode,
                                      > >> as this also is much simpler to do. The plugin contains a hard-coded
                                      > >> maximum of 300 ms; attached patch reduces that somewhat arbitrarily to a
                                      > >> fifth, hopefully unnoticeable 60 ms. This way, there's no need to
                                      > >> configure anything, and you still reap the benefits of matchparen in
                                      > >> most cases, even for problematic files / file types. This only leaves
                                      > >> out old Vim versions that don't have the {timeout} argument on
                                      > >> searchpairpos(), but as you're the first to raise this issue, it may not
                                      > >> be that widespread to bother.
                                      > >
                                      > > Thanks, makes sense.
                                      > >
                                      > > So, how do we decide on the timeout?  300 msec is too much, 60 msec is
                                      > > OK?  Perhaps we should make this time configurable.
                                      >
                                      > If Fanhe agrees with the proposed change, I'd rather not make it more
                                      > complex so far. Although I'm usually a big proponent of configurability,
                                      > the values seem to be fine for 99,99% of users, and a maximum, corner
                                      > case delay of 1/3 s while moving around seems as reasonable as a barely
                                      > noticeable 60 ms while typing.

                                      It's not so complicated:

                                      if !exists("g:matchparen_timeout")
                                        let g:matchparen_timeout = 300
                                      endif
                                      if !exists("g:matchparen_insert_timeout")
                                        let g:matchparen_insert_timeout = 60
                                      endif

                                      ...


                                        if mode() == 'i' || mode() == 'R'
                                          let timeout = exists("b:matchparen_insert_timeout") ? b:matchparen_insert_timeout : g:matchparen_insert_timeout
                                        else
                                          let timeout = exists("b:matchparen_timeout") ? b:matchparen_timeout : g:matchparen_timeout
                                        endif

                                      --
                                      ZOOT:  I'm afraid our life must seem very dull and quiet compared to yours.
                                             We are but eightscore young blondes, all between sixteen and
                                             nineteen-and-a-half, cut off in this castle, with no one to protect us.
                                             Oooh.  It is a lonely life ... bathing ...  dressing ... undressing ...
                                             making exciting underwear....
                                                       "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

                                       /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net   \\\
                                      ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                                      \\\  an exciting new programming language -- http://www.Zimbu.org        ///
                                       \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

                                      --
                                      --
                                      You received this message from the "vim_dev" maillist.
                                      Do not top-post! Type your reply below the text you are replying to.
                                      For more information, visit http://www.vim.org/maillist.php

                                      ---
                                      You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                      For more options, visit https://groups.google.com/groups/opt_out.



                                      --
                                      --
                                      You received this message from the "vim_dev" maillist.
                                      Do not top-post! Type your reply below the text you are replying to.
                                      For more information, visit http://www.vim.org/maillist.php
                                       
                                      ---
                                      You received this message because you are subscribed to the Google Groups "vim_dev" group.
                                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                                      For more options, visit https://groups.google.com/groups/opt_out.
                                       
                                       
                                    Your message has been successfully submitted and would be delivered to recipients shortly.