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

multiple copy

Expand Messages
  • Payal Rathod
    Hi all, I usually select a block of text in visual mode and use d to cut it. I want to paste it somewhere later in the session. How can I cut more than 1 block
    Message 1 of 8 , Feb 28, 2003
      Hi all,
      I usually select a block of text in visual mode and use d to cut it.
      I want to paste it somewhere later in the session. How can I cut more
      than 1 block and keep it in different buffer? What happens is that I cut
      a block and sometimes later I use dw or dd and the block gets
      overwritten. I want to keep it safe in some buffer. How to do it?

      Thanks and bye.
      With regards,
      -Payal


      --
      "Visit GNU/Linux Success Stories"
      www.geocities.com/rpayal99
      Guest-Book Section Updated.
    • Antoine J. Mechelynck
      ... see :help quote_number HTH, Tony
      Message 2 of 8 , Feb 28, 2003
        Payal Rathod <payal@...> wrote:
        > Hi all,
        > I usually select a block of text in visual mode and use d to cut it.
        > I want to paste it somewhere later in the session. How can I cut more
        > than 1 block and keep it in different buffer? What happens is that I
        > cut a block and sometimes later I use dw or dd and the block gets
        > overwritten. I want to keep it safe in some buffer. How to do it?
        >
        > Thanks and bye.
        > With regards,
        > -Payal
        >
        >
        > --
        > "Visit GNU/Linux Success Stories"
        > www.geocities.com/rpayal99
        > Guest-Book Section Updated.

        see :help quote_number

        HTH,
        Tony
      • England, Richard
        ... should shed some light on this, as well. You might take a look at the fine help system and the tutorial that accompanies VIM.
        Message 3 of 8 , Feb 28, 2003
          :help delete

          should shed some light on this, as well.

          You might take a look at the fine help system and the tutorial that
          accompanies VIM.



          On 2/28/03 11:46 AM, Payal Rathod wrote:

          >Hi all,
          >I usually select a block of text in visual mode and use d to cut it.
          >I want to paste it somewhere later in the session. How can I cut more
          >than 1 block and keep it in different buffer? What happens is that I cut
          >a block and sometimes later I use dw or dd and the block gets
          >overwritten. I want to keep it safe in some buffer. How to do it?
          >
          >Thanks and bye.
          >With regards,
          >-Payal
          >
          >
          >
          >
        • Yiu Wing
          ... The last ten deleted blocks are in the numbered registers, and the - register contains the last deleted text that s less than a line. To see these
          Message 4 of 8 , Feb 28, 2003
            > Hi all,
            > I usually select a block of text in visual mode and use d to cut it.
            > I want to paste it somewhere later in the session. How can I cut more
            > than 1 block and keep it in different buffer? What happens is that I cut
            > a block and sometimes later I use dw or dd and the block gets
            > overwritten. I want to keep it safe in some buffer. How to do it?

            The last ten deleted blocks are in the numbered registers, and the '-'
            register contains the last deleted text that's less than a line. To see
            these deleted texts, you can do

            :register

            to find out.

            To paste them in your file, in normal do <c-r> and then type the number or
            '-' to paste the content of the corresponding register.

            For more details check out

            :h registers

            Regards,

            Yiu Wing

            > Thanks and bye.
            > With regards,
            > -Payal
            >
            >
            > --
            > "Visit GNU/Linux Success Stories"
            > www.geocities.com/rpayal99
            > Guest-Book Section Updated.
            >
          • Ross A. Osborn
            ... This is for insert mode not normal mode. ... Yes. Read this. I think it will answer all your questions. Instead of relying on the numbered registers and
            Message 5 of 8 , Feb 28, 2003
              On Fri, Feb 28, 2003 at 07:58:46PM -0000, Yiu Wing wrote:
              > > Hi all,
              > > I usually select a block of text in visual mode and use d to cut it.
              > > I want to paste it somewhere later in the session. How can I cut more
              > > than 1 block and keep it in different buffer? What happens is that I cut
              > > a block and sometimes later I use dw or dd and the block gets
              > > overwritten. I want to keep it safe in some buffer. How to do it?
              >
              > The last ten deleted blocks are in the numbered registers, and the '-'
              > register contains the last deleted text that's less than a line. To see
              > these deleted texts, you can do
              >
              > :register
              >
              > to find out.
              >
              > To paste them in your file, in normal do <c-r> and then type the number or
              > '-' to paste the content of the corresponding register.

              This is for insert mode not normal mode.

              >
              > For more details check out
              >
              > :h registers

              Yes. Read this. I think it will answer all your questions.


              Instead of relying on the numbered registers and having to remember that
              the text you want to paste was the 7th most recent delete you might want
              to use the named registers a-z.

              To delete a word and save it in register 'b':

              "bdw


              To copy (yank) a word into register 'b' without deleting it:

              "byw


              Then to paste it back into a file (possibly a different file):

              "bp


              Ross
            • Yiu Wing
              [snipped] ... or ... Well spotted! I ll the blame the misarable weather today that has caused this sematic typo...
              Message 6 of 8 , Feb 28, 2003
                [snipped]
                > >
                > > To paste them in your file, in normal do <c-r> and then type the number
                or
                > > '-' to paste the content of the corresponding register.
                >
                > This is for insert mode not normal mode.

                Well spotted! I'll the blame the misarable weather today that has caused
                this sematic typo...

                > >
                > > For more details check out
                > >
                > > :h registers
                >
                > Yes. Read this. I think it will answer all your questions.
                >
                >
                > Instead of relying on the numbered registers and having to remember that
                > the text you want to paste was the 7th most recent delete you might want
                > to use the named registers a-z.
                >
                > To delete a word and save it in register 'b':
                >
                > "bdw
                >
                >
                > To copy (yank) a word into register 'b' without deleting it:
                >
                > "byw
                >
                >
                > Then to paste it back into a file (possibly a different file):
                >
                > "bp
                >
                >
                > Ross
              • Payal Rathod
                Hi, Thanks for the mails. I *think* I got it cleared. Just confirming this. The comments besides each line indicate what I did. I have, $ vim sample.dat Line 1
                Message 7 of 8 , Mar 1, 2003
                  Hi,
                  Thanks for the mails. I *think* I got it cleared. Just confirming this.
                  The comments besides each line indicate what I did.
                  I have,

                  $ vim sample.dat

                  Line 1 # "ayy
                  Line 2 # "bdd
                  Line 3 # "cyy
                  Line 4 # "myy
                  Line 5
                  Line 6

                  So it means that now I have Line 1,2,3,4 in registers a,b,c,m
                  respectively. Right?

                  Now I go to Line 5 and do "dd" and similarly on Line 6. Which registers
                  are now Line 5 and Line 6 copied into by default?

                  Thanks a lot for all the help.
                  With warm regards,
                  -Payal


                  --
                  "Visit GNU/Linux Success Stories"
                  www.geocities.com/rpayal99
                  Guest-Book Section Updated.
                • Ross A. Osborn
                  ... Yes. ... Register 1 has the last delete (Line 6) and register 2 has the delete before that (Line 5). Ross
                  Message 8 of 8 , Mar 1, 2003
                    On Sat, Mar 01, 2003 at 06:15:40PM +0530, Payal Rathod wrote:
                    > Hi,
                    > Thanks for the mails. I *think* I got it cleared. Just confirming this.
                    > The comments besides each line indicate what I did.
                    > I have,
                    >
                    > $ vim sample.dat
                    >
                    > Line 1 # "ayy
                    > Line 2 # "bdd
                    > Line 3 # "cyy
                    > Line 4 # "myy
                    > Line 5
                    > Line 6
                    >
                    > So it means that now I have Line 1,2,3,4 in registers a,b,c,m
                    > respectively. Right?

                    Yes.

                    >
                    > Now I go to Line 5 and do "dd" and similarly on Line 6. Which registers
                    > are now Line 5 and Line 6 copied into by default?

                    Register '1' has the last delete (Line 6) and register '2' has the
                    delete before that (Line 5).

                    Ross
                  Your message has been successfully submitted and would be delivered to recipients shortly.