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

Accidentally pasting in Command Line mode

Expand Messages
  • Andy
    Hi there, I have one major annoyance with MacVim, which I m surprised I can t find anyone else mentioning. Specifically, on a semi-regular basis, I copy a
    Message 1 of 10 , Jul 3, 2010
      Hi there,

      I have one major annoyance with MacVim, which I'm surprised I can't
      find anyone else mentioning. Specifically, on a semi-regular basis, I
      copy a large amount of text from, e.g., a terminal session, switch to
      vim, paste it, and - bang! I discover I was in command line mode and
      as a result I am in for a long wait. For example I just did this with
      235 lines of text, and had to wait around 10 minutes before vim was in
      a usable state again. I can't interrupt with Ctrl-C nor Ctrl-Z. And
      the rate of pasting seems to slow down exponentially, so you see
      characters crawling along at a rate of about 10 a second.

      I suppose I could remap Cmd-V on the command line, but I often want to
      use it in that mode legitimately (with much less test).

      Does anyone else see this behaviour? I only see it in the GUI version,
      not in a terminal. Can anyone suggest a workaround? Or perhaps a way
      of limiting the amount of text that can be copied to command-line
      mode? Or a way of interrupting that I don't know? Any help much
      appreciated. Thanks in advance,

      Andy

      --
      You received this message from the "vim_mac" 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
    • björn
      Hi, ... Ouch! I was not aware of this problem. Fortunately there is an easy fix: use Cmd-. instead of Ctrl-C to interrupt. Of course, Ctrl-C _should_ work
      Message 2 of 10 , Jul 4, 2010
        Hi,

        On 3 July 2010 21:25, Andy wrote:
        >
        > I have one major annoyance with MacVim, which I'm surprised I can't
        > find anyone else mentioning. Specifically, on a semi-regular basis, I
        > copy a large amount of text from, e.g., a terminal session, switch to
        > vim, paste it, and - bang! I discover I was in command line mode and
        > as a result I am in for a long wait. For example I just did this with
        > 235 lines of text, and had to wait around 10 minutes before vim was in
        > a usable state again. I can't interrupt with Ctrl-C nor Ctrl-Z. And
        > the rate of pasting seems to slow down exponentially, so you see
        > characters crawling along at a rate of about 10 a second.

        Ouch! I was not aware of this problem. Fortunately there is an easy
        fix: use Cmd-. instead of Ctrl-C to interrupt.

        Of course, Ctrl-C _should_ work but in some cases it does not because
        it requires that Vim checks for incoming events. Sometimes when its
        stuck in a long loop (like in your situation) it seems to "forget" to
        do so. I will try to hunt down where it is stuck now and make it
        check for incoming events and Ctrl-C will once more work.

        It is because of situations such as this that I added Cmd-. as another
        way of interrupting Vim (note that Cmd-. is the standard way to
        interrupt Mac apps). It does not require Vim to check for incoming
        events, instead it sends SIGINT to the Vim process so in general it is
        a more effective way of halting Vim. (All of this is hidden under ":h
        cmd-." in the MacVim help by the way.)

        So, use Cmd-. for now. I'll try to make Ctrl-C work again when I get the time.

        Björn

        --
        You received this message from the "vim_mac" 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
      • Andy Block
        ... Hi Björn, Thanks for you quick response, and suggested workaround. However, Cmd-. also does not appear to interrupt for me. Did you confirm that it worked
        Message 3 of 10 , Jul 4, 2010
          On Jul 4, 2010, at 12:58 PM, björn wrote:

          > On 3 July 2010 21:25, Andy wrote:
          >>
          >> I have one major annoyance with MacVim, which I'm surprised I can't
          >> find anyone else mentioning. Specifically, on a semi-regular basis, I
          >> copy a large amount of text from, e.g., a terminal session, switch to
          >> vim, paste it, and - bang! I discover I was in command line mode and
          >> as a result I am in for a long wait.
          >
          > Ouch! I was not aware of this problem. Fortunately there is an easy
          > fix: use Cmd-. instead of Ctrl-C to interrupt.

          Hi Björn,

          Thanks for you quick response, and suggested workaround. However, Cmd-. also does not appear to interrupt for me. Did you confirm that it worked for you? Would this behaviour depend on any configuration, or the setting of some option? Thanks again,

          Andy

          --
          You received this message from the "vim_mac" 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
        • Andy Block
          ... Hi again, It just occurred to me that the reason this does not bite me in terminal vim is that pasting there results in the first pasted line being
          Message 4 of 10 , Jul 4, 2010
            On Jul 4, 2010, at 12:58 PM, björn wrote:

            > On 3 July 2010 21:25, Andy wrote:
            >>
            >> I have one major annoyance with MacVim, which I'm surprised I can't
            >> find anyone else mentioning. Specifically, on a semi-regular basis, I
            >> copy a large amount of text from, e.g., a terminal session, switch to
            >> vim, paste it, and - bang! I discover I was in command line mode and
            >> as a result I am in for a long wait.
            > Ouch! I was not aware of this problem. Fortunately there is an easy
            > fix: use Cmd-. instead of Ctrl-C to interrupt.

            Hi again,

            It just occurred to me that the reason this does not bite me in terminal vim is that pasting there results in the first pasted line being interpreted as a command, then the remaining lines get interpreted in normal mode, where they are swiftly interpreted and can easily be undone. In the GUI, however, the line separators get pasted as 'literal' ^M s on the command line, resulting in one huge command line. Furthermore, even if I take an equivalent amount os text but join all the lines onto a single line, and then cut and paste that onto a terminal command line, the paste is complete in a matter of less than a second (when using a buffer that takes over two minutes to paste into the GUI version). This suggests two other possible mitigating actions:

            1. Make the behaviour for '^M' the same as the terminal version
            2. Speed up the insertion of characters on the command line so they don't need interrupting :-)

            In any case, thanks again for this and all your hard work on MacVim. It is a fantastic piece of software :-) . Regards,

            Andy

            --
            You received this message from the "vim_mac" 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
          • björn
            ... Yes, I did confirm before posting. Which version of MacVim are you using? You should be using a snapshot, or the 7.3a BETA [1] -- the stable build is
            Message 5 of 10 , Jul 4, 2010
              On 4 July 2010 13:13, Andy Block wrote:
              > On Jul 4, 2010, at 12:58 PM, björn wrote:
              >
              >> On 3 July 2010 21:25, Andy wrote:
              >>>
              >>> I have one major annoyance with MacVim, which I'm surprised I can't
              >>> find anyone else mentioning. Specifically, on a semi-regular basis, I
              >>> copy a large amount of text from, e.g., a terminal session, switch to
              >>> vim, paste it, and - bang! I discover I was in command line mode and
              >>> as a result I am in for a long wait.
              >>
              >> Ouch!  I was not aware of this problem.  Fortunately there is an easy
              >> fix: use Cmd-. instead of Ctrl-C to interrupt.
              >
              > Thanks for you quick response, and suggested workaround. However, Cmd-. also does not appear to interrupt for me. Did you confirm that it worked for you? Would this behaviour depend on any configuration, or the setting of some option? Thanks again,

              Yes, I did confirm before posting. Which version of MacVim are you
              using? You should be using a snapshot, or the 7.3a BETA [1] -- the
              stable build is probably too old. No configuration option will affect
              Cmd-. (it is hardwired).

              Björn

              [1] http://github.com/b4winckler/macvim/downloads

              --
              You received this message from the "vim_mac" 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
            • björn
              ... Thanks for the information -- I will try to take a look at why the GUI is so slow. ... Thanks, I m glad you like it. :-) Björn -- You received this
              Message 6 of 10 , Jul 4, 2010
                On 4 July 2010 13:26, Andy Block wrote:
                > On Jul 4, 2010, at 12:58 PM, björn wrote:
                >
                >> On 3 July 2010 21:25, Andy wrote:
                >>>
                >>> I have one major annoyance with MacVim, which I'm surprised I can't
                >>> find anyone else mentioning. Specifically, on a semi-regular basis, I
                >>> copy a large amount of text from, e.g., a terminal session, switch to
                >>> vim, paste it, and - bang! I discover I was in command line mode and
                >>> as a result I am in for a long wait.
                >> Ouch!  I was not aware of this problem.  Fortunately there is an easy
                >> fix: use Cmd-. instead of Ctrl-C to interrupt.
                >
                > It just occurred to me that the reason this does not bite me in terminal vim is that pasting there results in the first pasted line being interpreted as a command, then the remaining lines get interpreted in normal mode, where they are swiftly interpreted and can easily be undone. In the GUI, however, the line separators get pasted as 'literal' ^M s on the command line, resulting in one huge command line. Furthermore, even if I take an equivalent amount os text but join all the lines onto a single line, and then cut and paste that onto a terminal command line, the paste is complete in a matter of less than a second (when using a buffer that takes over two minutes to paste into the GUI version). This suggests two other possible mitigating actions:
                >
                > 1. Make the behaviour for '^M' the same as the terminal version
                > 2. Speed up the insertion of characters on the command line so they don't need interrupting :-)

                Thanks for the information -- I will try to take a look at why the GUI
                is so slow.

                > In any case, thanks again for this and all your hard work on MacVim. It is a fantastic piece of software :-) .

                Thanks, I'm glad you like it. :-)

                Björn

                --
                You received this message from the "vim_mac" 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
              • Andy Block
                ... Ah - that d be it then. I should have mentioned before that I am indeed using the last stable build (7.2). I ll have a go with something more recent then.
                Message 7 of 10 , Jul 4, 2010
                  On Jul 4, 2010, at 3:46 PM, björn wrote:

                  > On 4 July 2010 13:13, Andy Block wrote:
                  >> On Jul 4, 2010, at 12:58 PM, björn wrote:
                  >>
                  >>> On 3 July 2010 21:25, Andy wrote:
                  >>>>
                  >>>> I have one major annoyance with MacVim, which I'm surprised I can't
                  >>>> find anyone else mentioning. Specifically, on a semi-regular basis, I
                  >>>> copy a large amount of text from, e.g., a terminal session, switch to
                  >>>> vim, paste it, and - bang! I discover I was in command line mode and
                  >>>> as a result I am in for a long wait.
                  >>>
                  >>> Ouch! I was not aware of this problem. Fortunately there is an easy
                  >>> fix: use Cmd-. instead of Ctrl-C to interrupt.
                  >>
                  >> Thanks for you quick response, and suggested workaround. However, Cmd-. also does not appear to interrupt for me. Did you confirm that it worked for you? Would this behaviour depend on any configuration, or the setting of some option? Thanks again,
                  >
                  > Yes, I did confirm before posting. Which version of MacVim are you
                  > using? You should be using a snapshot, or the 7.3a BETA [1] -- the
                  > stable build is probably too old. No configuration option will affect
                  > Cmd-. (it is hardwired).

                  Ah - that'd be it then. I should have mentioned before that I am indeed using the last stable build (7.2). I'll have a go with something more recent then. Thanks again, regards,

                  Andy

                  --
                  You received this message from the "vim_mac" 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
                • Andy Block
                  ... This should be my last posting on this matter - I just wanted to confirm that interrupting with Cmd-. on 7.3a BETA works fine for me. Furthermore, the
                  Message 8 of 10 , Jul 4, 2010
                    On Jul 4, 2010, at 3:46 PM, björn wrote:

                    > On 4 July 2010 13:13, Andy Block wrote:
                    >> On Jul 4, 2010, at 12:58 PM, björn wrote:
                    >>
                    >>> On 3 July 2010 21:25, Andy wrote:
                    >>>>
                    >>>> I have one major annoyance with MacVim, which I'm surprised I can't
                    >>>> find anyone else mentioning. Specifically, on a semi-regular basis, I
                    >>>> copy a large amount of text from, e.g., a terminal session, switch to
                    >>>> vim, paste it, and - bang! I discover I was in command line mode and
                    >>>> as a result I am in for a long wait.
                    >>>
                    >>> Ouch! I was not aware of this problem. Fortunately there is an easy
                    >>> fix: use Cmd-. instead of Ctrl-C to interrupt.
                    >>
                    >> Thanks for you quick response, and suggested workaround. However, Cmd-. also does not appear to interrupt for me. Did you confirm that it worked for you? Would this behaviour depend on any configuration, or the setting of some option? Thanks again,
                    >
                    > Yes, I did confirm before posting. Which version of MacVim are you
                    > using? You should be using a snapshot, or the 7.3a BETA [1] -- the
                    > stable build is probably too old. No configuration option will affect
                    > Cmd-. (it is hardwired).

                    This should be my last posting on this matter - I just wanted to confirm that interrupting with Cmd-. on 7.3a BETA works fine for me. Furthermore, the paste seems to have sped up hugely since 7.2 anyway (possibly because, I notice, the screen is not refreshed after every character?). The paste that I previously reported as taking over 2 minutes now takes a much more reasonable 7 seconds. Consider me a happy customer! Thanks,

                    Andy

                    --
                    You received this message from the "vim_mac" 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
                  • Carl Jacobsen
                    ... (Sorry to come in at the end, just back from the long weekend.) So, I paste text into MacVim all the time (with either Cmd-C/Cmd-V, or drag and drop), and
                    Message 9 of 10 , Jul 6, 2010
                      On 3 July 2010 21:25, Andy wrote:

                      > I have one major annoyance with MacVim, which I'm surprised I can't
                      > find anyone else mentioning. Specifically, on a semi-regular basis, I
                      > copy a large amount of text from, e.g., a terminal session, switch to
                      > vim, paste it, and - bang! I discover I was in command line mode and
                      > as a result I am in for a long wait.

                      (Sorry to come in at the end, just back from the long weekend.)

                      So, I paste text into MacVim all the time (with either Cmd-C/Cmd-V,
                      or drag and drop), and have always been pleased/grateful [THANKS BJÖRN!]
                      that it cheerfully inserted the text whether I was in command mode or
                      insert mode (after long painful experience with pasting into vi/vim
                      in the terminal and waiting while text was misinterpreted as a long
                      sequence of commands).

                      You say you're having this problem in command *line* mode -- if I'm
                      understanding right... is there some reason why you would go out of
                      your way to type ":" to get into command line mode, before switching
                      away from MacVim? Or am I misunderstanding?

                      Just curious,
                      Carl

                      --
                      You received this message from the "vim_mac" 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
                    • Andy Block
                      ... Hi Carl, Indeed, I am also most grateful that pasting in command or normal mode works with no problem. As a vi user in the (dim and distant) past, I know
                      Message 10 of 10 , Jul 6, 2010
                        On Jul 6, 2010, at 8:56 PM, Carl Jacobsen wrote:

                        > On 3 July 2010 21:25, Andy wrote:
                        >
                        >> I have one major annoyance with MacVim, which I'm surprised I can't find anyone else mentioning. Specifically, on a semi-regular basis, I copy a large amount of text from, e.g., a terminal session, switch to vim, paste it, and - bang! I discover I was in command line mode and as a result I am in for a long wait.
                        >
                        > (Sorry to come in at the end, just back from the long weekend.)
                        >
                        > So, I paste text into MacVim all the time (with either Cmd-C/Cmd-V, or drag and drop), and have always been pleased/grateful [THANKS BJÖRN!] that it cheerfully inserted the text whether I was in command mode or insert mode (after long painful experience with pasting into vi/vim in the terminal and waiting while text was misinterpreted as a long sequence of commands).
                        >
                        > You say you're having this problem in command *line* mode -- if I'm understanding right... is there some reason why you would go out of your way to type ":" to get into command line mode, before switching away from MacVim? Or am I misunderstanding?

                        Hi Carl,

                        Indeed, I am also most grateful that pasting in command or normal mode works with no problem. As a vi user in the (dim and distant) past, I know the pain that can result from pasting in 'normal mode' in vi (especially without multi-level undo). I certainly don't go out of my way to type ':' before pasting. It is more that I maybe went to vim, entered ':' with the intention of entering some command, then got interrupted, switch to skype to respond to something, went to firefox to look something up, then notice a mail that needs attention. Then I go to a terminal to copy some text I needed, before switching back to vim. Then I check which file I am pasting into, perhaps without carefully checking the bottom left for a ':', and... oops! It's not an everyday occurrence, but it has bitten me 4 or 5 times now. Hope that clarifies! Regards,

                        Andy

                        --
                        You received this message from the "vim_mac" 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
                      Your message has been successfully submitted and would be delivered to recipients shortly.