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

Re: block mode paste feature

Expand Messages
  • Charles E Campbell
    ... Seems to me that you could set up a pair of vnoremaps (of p and P) to do what you want: vn P I vn p A Regards, Chip Campbell --
    Message 1 of 8 , Sep 12, 2013
    • 0 Attachment
      shawn wilson wrote:
      > Can vim be made to DWIM here? I did a quick search and found I'm not
      > the only one who has run into this. For example:
      > http://briancarper.net/blog/341/
      >
      > Just to re-explain what I want: when you visually select a block, you
      > can change or insert and it will change the block but when you paste a
      > single line buffer (I can see how this might get not be so simple for
      > pasting multiple lines) it only changes the first line. The "fix" of
      > using C+R in insert mode as was mentioned works, but the behavior
      > isn't what I expect.
      >
      Seems to me that you could set up a pair of vnoremaps (of p and P) to do
      what you want:

      vn P I<c-r>"<esc>
      vn p A<c-r>"<esc>

      Regards,
      Chip Campbell

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • shawn wilson
      Not a bad idea. I guess no one thinks this should be an internal feature ? On Thu, Sep 12, 2013 at 10:04 PM, Charles E Campbell
      Message 2 of 8 , Sep 12, 2013
      • 0 Attachment
        Not a bad idea.

        I guess no one thinks this should be an internal 'feature'?


        On Thu, Sep 12, 2013 at 10:04 PM, Charles E Campbell <drchip@...> wrote:
        shawn wilson wrote:
        Can vim be made to DWIM here? I did a quick search and found I'm not the only one who has run into this. For example:
        http://briancarper.net/blog/341/

        Just to re-explain what I want: when you visually select a block, you can change or insert and it will change the block but when you paste a single line buffer (I can see how this might get not be so simple for pasting multiple lines) it only changes the first line. The "fix" of using C+R in insert mode as was mentioned works, but the behavior isn't what I expect.

        Seems to me that you could set up a pair of vnoremaps (of p and P) to do what you want:

        vn P    I<c-r>"<esc>
        vn p    A<c-r>"<esc>

        Regards,
        Chip Campbell

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
        For more options, visit https://groups.google.com/groups/opt_out.

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Christian Brabandt
        ... Try the attached patch. regards, Christian -- Wir leben in einer Demokratie, und jeder kann frei entscheiden, welche Sportart er machen möchte. -- Michael
        Message 3 of 8 , Sep 18, 2013
        • 0 Attachment
          On Do, 12 Sep 2013, shawn wilson wrote:

          > Can vim be made to DWIM here? I did a quick search and found I'm not the
          > only one who has run into this. For example:
          > http://briancarper.net/blog/341/
          >
          > Just to re-explain what I want: when you visually select a block, you can
          > change or insert and it will change the block but when you paste a single
          > line buffer (I can see how this might get not be so simple for pasting
          > multiple lines) it only changes the first line. The "fix" of using C+R in
          > insert mode as was mentioned works, but the behavior isn't what I expect.

          Try the attached patch.

          regards,
          Christian
          --
          Wir leben in einer Demokratie, und jeder kann frei entscheiden,
          welche Sportart er machen möchte.
          -- Michael Schumacher

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Bram Moolenaar
          ... I m missing something here: How do you paste? These block operations have had bugs in the past. If we make changes in this code it would be a good idea to
          Message 4 of 8 , Sep 19, 2013
          • 0 Attachment
            Christian Brabandt wrote:

            > On Do, 12 Sep 2013, shawn wilson wrote:
            >
            > > Can vim be made to DWIM here? I did a quick search and found I'm not the
            > > only one who has run into this. For example:
            > > http://briancarper.net/blog/341/
            > >
            > > Just to re-explain what I want: when you visually select a block, you can
            > > change or insert and it will change the block but when you paste a single
            > > line buffer (I can see how this might get not be so simple for pasting
            > > multiple lines) it only changes the first line. The "fix" of using C+R in
            > > insert mode as was mentioned works, but the behavior isn't what I expect.
            >
            > Try the attached patch.

            I'm missing something here: How do you paste?

            These block operations have had bugs in the past. If we make changes in
            this code it would be a good idea to at least have some basic tests.


            --
            Get a life? What is the URL where it can be downloaded?

            /// 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_use" 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_use" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Christian Brabandt
            ... This is now possible with Vim 7.4.034 regards, Christian -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply
            Message 5 of 8 , Sep 23, 2013
            • 0 Attachment
              On Thu, September 12, 2013 13:38, shawn wilson wrote:
              > Can vim be made to DWIM here? I did a quick search and found I'm not the
              > only one who has run into this. For example:
              > http://briancarper.net/blog/341/
              >
              > Just to re-explain what I want: when you visually select a block, you can
              > change or insert and it will change the block but when you paste a single
              > line buffer (I can see how this might get not be so simple for pasting
              > multiple lines) it only changes the first line. The "fix" of using C+R in
              > insert mode as was mentioned works, but the behavior isn't what I expect.

              This is now possible with Vim 7.4.034

              regards,
              Christian

              --
              --
              You received this message from the "vim_use" 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_use" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Bruno Sutic
              ... Is this documented in vim help somewhere? Thanks -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the
              Message 6 of 8 , Sep 26, 2013
              • 0 Attachment
                On Monday, September 23, 2013 2:54:28 PM UTC+2, Christian Brabandt wrote:
                > On Thu, September 12, 2013 13:38, shawn wilson wrote:
                >
                > > Can vim be made to DWIM here? I did a quick search and found I'm not the
                >
                > > only one who has run into this. For example:
                >
                > > http://briancarper.net/blog/341/
                >
                > >
                >
                > > Just to re-explain what I want: when you visually select a block, you can
                >
                > > change or insert and it will change the block but when you paste a single
                >
                > > line buffer (I can see how this might get not be so simple for pasting
                >
                > > multiple lines) it only changes the first line. The "fix" of using C+R in
                >
                > > insert mode as was mentioned works, but the behavior isn't what I expect.
                >
                >
                >
                > This is now possible with Vim 7.4.034
                >
                >
                >
                > regards,
                >
                > Christian

                Is this documented in vim help somewhere? Thanks

                --
                --
                You received this message from the "vim_use" 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_use" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Gary Johnson
                ... It s been added as the last paragraph of ... Regards, Gary -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply
                Message 7 of 8 , Sep 26, 2013
                • 0 Attachment
                  On 2013-09-26, Bruno Sutic wrote:
                  > On Monday, September 23, 2013 2:54:28 PM UTC+2, Christian Brabandt wrote:
                  > > On Thu, September 12, 2013 13:38, shawn wilson wrote:
                  > > > Can vim be made to DWIM here? I did a quick search and found I'm not the
                  > > > only one who has run into this. For example:
                  > > > http://briancarper.net/blog/341/
                  > > >
                  > > > Just to re-explain what I want: when you visually select a block, you can
                  > > > change or insert and it will change the block but when you paste a single
                  > > > line buffer (I can see how this might get not be so simple for pasting
                  > > > multiple lines) it only changes the first line. The "fix" of using C+R in
                  > > > insert mode as was mentioned works, but the behavior isn't what I expect.
                  > >
                  > > This is now possible with Vim 7.4.034

                  > Is this documented in vim help somewhere? Thanks

                  It's been added as the last paragraph of

                  :help v_p

                  Regards,
                  Gary

                  --
                  --
                  You received this message from the "vim_use" 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_use" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+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.