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

Cycling Through Previously Selected Text

Expand Messages
  • The Vim Man
    Here s an interesting idea I came across at groups.google.com, but nobody seemed to know how to do this. Any ideas? I know that you can reselect the
    Message 1 of 11 , Jul 28, 2002
    • 0 Attachment
      Here's an interesting idea I came across at groups.google.com, but
      nobody seemed to know how to do this. Any ideas?
      "I know that you can reselect the previously selected text in Vim, but
      is there any way that you can cycle through all the previously selected
      text selections (not only the first one)."

      --
      http://fastmail.fm
      - Taking the "ail" out of email!
    • Benji Fisher
      ... I do not think this can be done. This would require adding a history for the
      Message 2 of 11 , Jul 30, 2002
      • 0 Attachment
        The Vim Man wrote:
        >
        > Here's an interesting idea I came across at groups.google.com, but
        > nobody seemed to know how to do this. Any ideas?
        > "I know that you can reselect the previously selected text in Vim, but
        > is there any way that you can cycle through all the previously selected
        > text selections (not only the first one)."

        I do not think this can be done. This would require adding a history for
        the '< and '> (Visual marks). Even then, it would be difficult to make it work
        really well.

        You can return to your previous positions in the buffer. See

        :help jump-motions

        HTH --Benji Fisher
      • Matthias Ulrich
        Hi, reading the Thread Cycling Through Previously Selected Text I thought its the right time to ask for a feature I ve been searching for a long time. Is
        Message 3 of 11 , Jul 30, 2002
        • 0 Attachment
          Hi,

          reading the Thread "Cycling Through Previously Selected Text" I thought its
          the right time to ask for a feature I've been searching for a long time.

          Is there away to cycle in a "p" through the content of the last
          yank-registers???

          I am sure this is possible and I always thought I will find it by myself one
          day,
          but so far no result...

          Any hints are welcome.


          Matthias
        • Benji Fisher
          ... Try (line breaks added for clarity) dd dd dd dd 1P... or (instead of the last line) 1Pu.u.u. ... HTH --Benji Fisher
          Message 4 of 11 , Jul 30, 2002
          • 0 Attachment
            On Tuesday, July 30, 2002, at 10:02 AM, Matthias Ulrich wrote:

            > Hi,
            >
            > reading the Thread "Cycling Through Previously Selected Text" I thought
            > its
            > the right time to ask for a feature I've been searching for a long time.
            >
            > Is there away to cycle in a "p" through the content of the last
            > yank-registers???
            >
            > I am sure this is possible and I always thought I will find it by
            > myself one
            > day,
            > but so far no result...

            Try (line breaks added for clarity)

            dd
            dd
            dd
            dd
            "1P...

            or (instead of the last line)

            "1Pu.u.u.

            :help undo-remarks

            HTH --Benji Fisher
          • Matthias Ulrich
            Hi, ... That s nice, now I just have to find my mapping for that... But there is one thing I discovered when I was reading the :help starting from your hint:
            Message 5 of 11 , Jul 31, 2002
            • 0 Attachment
              Hi,

              > dd
              > dd
              > dd
              > dd
              > "1P...
              >
              > or (instead of the last line)
              >
              > "1Pu.u.u.
              >
              > :help undo-remarks
              >

              That's nice, now I just have to find my mapping for that...

              But there is one thing I discovered when I was reading the :help
              starting from your hint:

              There must be a reason why the most recent yank is put in "0
              but the most recent delete is put in "1.

              ( And why is everything always also put in "" ? )

              This could help for my understanding.
              Thanks.

              Matthias
            • Benji Fisher
              ... This is an often overlooked feature. When you delete text, you may or may not want to paste it in later. You only yank text with the intention of pasting
              Message 6 of 11 , Jul 31, 2002
              • 0 Attachment
                Matthias Ulrich wrote:
                >
                > But there is one thing I discovered when I was reading the :help
                > starting from your hint:
                >
                > There must be a reason why the most recent yank is put in "0
                > but the most recent delete is put in "1.
                >
                > ( And why is everything always also put in "" ? )
                >
                > This could help for my understanding.
                > Thanks.

                This is an often overlooked feature. When you delete text, you may or may
                not want to paste it in later. You only yank text with the intention of pasting
                it. Thus it is good design that yanks are not overwritten by deletes.
                Everything (unless the "_ register is specified) is put into the "" register so
                that you can paste your most recent yank or delete without having to specify a
                register.

                HTH --Benji Fisher
              • rb@raphinou.com
                ... I ve got the other behaviour, if doing this: yy dd p The line deleted by dd is put, and not the line yanked. Or did I misundertand something? Raph -- Free
                Message 7 of 11 , Aug 1, 2002
                • 0 Attachment
                  > This is an often overlooked feature. When you delete text, you may or may
                  > not want to paste it in later. You only yank text with the intention of pasting
                  > it. Thus it is good design that yanks are not overwritten by deletes.

                  I've got the other behaviour,
                  if doing this:
                  yy
                  dd
                  p

                  The line deleted by dd is put, and not the line yanked.
                  Or did I misundertand something?

                  Raph


                  --
                  Free and Open Source Developers' European Meeting
                  http://www.fosdem.org
                • Benji Fisher
                  ... That s right. Try yy dd 0p So you get the most recent (yank or delete) most easily, from the unnamed (default or ) register, but you can get the most
                  Message 8 of 11 , Aug 1, 2002
                  • 0 Attachment
                    rb@... wrote:
                    >
                    > > This is an often overlooked feature. When you delete text, you may or may
                    > > not want to paste it in later. You only yank text with the intention of pasting
                    > > it. Thus it is good design that yanks are not overwritten by deletes.
                    >
                    > I've got the other behaviour,
                    > if doing this:
                    > yy
                    > dd
                    > p
                    >
                    > The line deleted by dd is put, and not the line yanked.
                    > Or did I misundertand something?

                    That's right. Try

                    yy
                    dd
                    "0p

                    So you get the most recent (yank or delete) most easily, from the unnamed
                    (default or "") register, but you can get the most recent yank (not delete)
                    using the "0 register.

                    :help "0

                    HTH --Benji Fisher
                  • David Fishburn
                    Benji made responded to this thread ... To get the most recent yank back... yy dd 0p So you get the most recent (yank or delete) most easily, from the unnamed
                    Message 9 of 11 , Aug 14, 2002
                    • 0 Attachment
                      Benji made responded to this thread ...


                      To get the most recent yank back...
                      yy
                      dd
                      "0p

                      So you get the most recent (yank or delete) most easily, from the
                      unnamed (default or "") register, but you can get the most recent yank
                      (not delete) using the "0 register.

                      :help "0

                      HTH --Benji Fisher
                    • David Fishburn
                      (oops, previous sent my mistake....) Benji made responded to this thread ... To cycle through deletes, you can do the following... dd dd dd dd 1P... or
                      Message 10 of 11 , Aug 14, 2002
                      • 0 Attachment
                        (oops, previous sent my mistake....)

                        Benji made responded to this thread ...


                        To cycle through deletes, you can do the following...
                        dd
                        dd
                        dd
                        dd
                        "1P...

                        or (instead of the last line)

                        "1Pu.u.u.

                        :help undo-remarks


                        To get the most recent yank back...
                        yy
                        dd
                        "0p

                        So you get the most recent (yank or delete) most easily, from the
                        unnamed (default or "") register, but you can get the most recent yank
                        (not delete) using the "0 register.

                        :help "0



                        I have read through the help, but there does not seem to be any
                        mechanism similar to "1P... For the 0 register. I just wanted to
                        confirm there is no way to cycle through previous "unnamed" yanks.

                        Thanks,
                        Dave
                      • Benji Fisher
                        ... AFAIK that is right. You will have to name your yanks if you want this. HTH --Benji Fisher
                        Message 11 of 11 , Aug 16, 2002
                        • 0 Attachment
                          David Fishburn wrote:
                          >
                          > I have read through the help, but there does not seem to be any
                          > mechanism similar to "1P... For the 0 register. I just wanted to
                          > confirm there is no way to cycle through previous "unnamed" yanks.

                          AFAIK that is right. You will have to name your yanks if you want this.

                          HTH --Benji Fisher
                        Your message has been successfully submitted and would be delivered to recipients shortly.