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

Yank range ?

Expand Messages
  • stosss
    ... It did not give me an error, but when I type: cP I don t get what I yanked. What I am doing wrong? What register is my yanked text in? -- If we can but
    Message 1 of 6 , Apr 30, 2010
    • 0 Attachment
      I went to :he y and I see:

      :[range]y[ank] [x] Yank [range] lines [into register x].

      so I do:

      :'y,'zy"c

      It did not give me an error, but when I type:

      "cP

      I don't get what I yanked.

      What I am doing wrong?
      What register is my yanked text in?


      --
      If we can but prevent the government from wasting the labours of the
      people, under the pretence of taking care of them, they must become
      happy. - Thomas Jefferson

      --
      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
    • sc
      ... i think it ll be in the un-named register ( ) i think what you wanted to do was ... if you want it in register c sc -- You received this message from the
      Message 2 of 6 , Apr 30, 2010
      • 0 Attachment
        On Friday 30 April 2010 9:17:57 pm stosss wrote:

        > I went to :he y and I see:
        > :[range]y[ank] [x] Yank [range] lines [into register x].
        >
        > so I do:
        > :'y,'zy"c
        >
        > It did not give me an error, but when I type:
        >
        > "cP
        >
        > I don't get what I yanked.
        >
        > What I am doing wrong?
        > What register is my yanked text in?

        i think it'll be in the un-named register (")

        i think what you wanted to do was

        :'y,'zyc

        if you want it in register c

        sc

        --
        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
      • stosss
        ... Yes typing P dumped my text into the file. ... This produced the E492 error So how does range yank into a named register work? -- If we can but prevent the
        Message 3 of 6 , Apr 30, 2010
        • 0 Attachment
          On Fri, Apr 30, 2010 at 10:46 PM, sc <toothpik@...> wrote:
          > On Friday 30 April 2010 9:17:57 pm stosss wrote:
          >
          >> I went to :he y and I see:
          >> :[range]y[ank] [x]    Yank [range] lines [into register x].
          >>
          >> so I do:
          >> :'y,'zy"c
          >>
          >> It did not give me an error, but when I type:
          >>
          >> "cP
          >>
          >> I don't get what I yanked.
          >>
          >> What I am doing wrong?
          >> What register is my yanked text in?
          >
          > i think it'll be in the un-named register (")

          Yes typing P dumped my text into the file.

          > i think what you wanted to do was
          >
          >    :'y,'zyc

          This produced the E492 error

          So how does range yank into a named register work?

          --
          If we can but prevent the government from wasting the labours of the
          people, under the pretence of taking care of them, they must become
          happy. - Thomas Jefferson

          --
          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
        • stosss
          ... Answering my own question. ... There has to be a space between yank and the register. -- If we can but prevent the government from wasting the labours of
          Message 4 of 6 , Apr 30, 2010
          • 0 Attachment
            On Fri, Apr 30, 2010 at 10:57 PM, stosss <stosss@...> wrote:
            > On Fri, Apr 30, 2010 at 10:46 PM, sc <toothpik@...> wrote:
            >> On Friday 30 April 2010 9:17:57 pm stosss wrote:
            >>
            >>> I went to :he y and I see:
            >>> :[range]y[ank] [x]    Yank [range] lines [into register x].
            >>>
            >>> so I do:
            >>> :'y,'zy"c
            >>>
            >>> It did not give me an error, but when I type:
            >>>
            >>> "cP
            >>>
            >>> I don't get what I yanked.
            >>>
            >>> What I am doing wrong?
            >>> What register is my yanked text in?
            >>
            >> i think it'll be in the un-named register (")
            >
            > Yes typing P dumped my text into the file.
            >
            >> i think what you wanted to do was
            >>
            >>    :'y,'zyc
            >
            > This produced the E492 error
            >
            > So how does range yank into a named register work?

            Answering my own question.

            This is the correct way:

            :'y,'zy c

            There has to be a space between yank and the register.

            --
            If we can but prevent the government from wasting the labours of the
            people, under the pretence of taking care of them, they must become
            happy. - Thomas Jefferson

            --
            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
          • sc
            ... it works fine when you remember the space between the y and the register (as it shows -- and i overlooked -- in the help module) what you really wanted
            Message 5 of 6 , Apr 30, 2010
            • 0 Attachment
              On Friday 30 April 2010 9:57:07 pm stosss wrote:

              > On Fri, Apr 30, 2010 at 10:46 PM, sc <toothpik@...>
              wrote:
              > > On Friday 30 April 2010 9:17:57 pm stosss wrote:
              > >> I went to :he y and I see:
              > >> :[range]y[ank] [x] Yank [range] lines [into register x].
              > >>
              > >> so I do:
              > >> :'y,'zy"c
              > >>
              > >> It did not give me an error, but when I type:
              > >>
              > >> "cP
              > >>
              > >> I don't get what I yanked.
              > >>
              > >> What I am doing wrong?
              > >> What register is my yanked text in?
              > >
              > > i think it'll be in the un-named register (")
              >
              > Yes typing P dumped my text into the file.
              >
              > > i think what you wanted to do was
              > >
              > > :'y,'zyc
              >
              > This produced the E492 error
              >
              > So how does range yank into a named register work?

              it works fine when you remember the space between the 'y' and the
              register (as it shows -- and i overlooked -- in the help module)

              what you really wanted to do was

              :'y,'zy c

              sc
              sc

              --
              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
            • Tony Mechelynck
              ... Yes, so Vim knows where the ex-command name ends (otherwise it ll think that you want some :yc command,and complain that there is none. In your initial
              Message 6 of 6 , May 1, 2010
              • 0 Attachment
                On 01/05/10 05:00, stosss wrote:
                > On Fri, Apr 30, 2010 at 10:57 PM, stosss<stosss@...> wrote:
                >> On Fri, Apr 30, 2010 at 10:46 PM, sc<toothpik@...> wrote:
                >>> On Friday 30 April 2010 9:17:57 pm stosss wrote:
                >>>
                >>>> I went to :he y and I see:
                >>>> :[range]y[ank] [x] Yank [range] lines [into register x].
                >>>>
                >>>> so I do:
                >>>> :'y,'zy"c
                >>>>
                >>>> It did not give me an error, but when I type:
                >>>>
                >>>> "cP
                >>>>
                >>>> I don't get what I yanked.
                >>>>
                >>>> What I am doing wrong?
                >>>> What register is my yanked text in?
                >>>
                >>> i think it'll be in the un-named register (")
                >>
                >> Yes typing P dumped my text into the file.
                >>
                >>> i think what you wanted to do was
                >>>
                >>> :'y,'zyc
                >>
                >> This produced the E492 error
                >>
                >> So how does range yank into a named register work?
                >
                > Answering my own question.
                >
                > This is the correct way:
                >
                > :'y,'zy c
                >
                > There has to be a space between yank and the register.
                >

                Yes, so Vim knows where the ex-command name ends (otherwise it'll think
                that you want some :yc command,and complain that there is none.

                In your initial command (with y"c), Vim sees the double-quote and
                anything following it as a comment, and therefore uses the "unnamed"
                register, ats it always does when a register is expected and you don't
                name one.


                Best regards,
                Tony.
                --
                "What is the Nature of God?"

                CLICK...CLICK...WHIRRR...CLICK...=BEEP!=
                1 QT. SOUR CREAM
                1 TSP. SAUERKRAUT
                1/2 CUT CHIVES.
                STIR AND SPRINKLE WITH BACON BITS.

                "I've just GOT to start labeling my software..."
                -- Bloom County

                --
                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
              Your message has been successfully submitted and would be delivered to recipients shortly.