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

Yank current word into a register e.g. register "+

Expand Messages
  • Paul
    Is there a way to yank the current word (in which the cursor resides) into a register? Currently, I do b +ye -- -- You received this message from the
    Message 1 of 6 , Jan 23, 2014
      Is there a way to yank the current word (in which the cursor resides) into a register? Currently, I do

      b"+ye

      --
      --
      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.
    • A. S. Budden
      +yaw or +yiw depending on how much you want to grab See :help aw and :help iw Al ... -- http://www.cgtk.co.uk -- -- You received this message from the
      Message 2 of 6 , Jan 23, 2014
        "+yaw or "+yiw depending on how much you want to grab

        See :help aw and :help iw

        Al

        On 23 January 2014 16:17, Paul <paul.domaskis@...> wrote:
        > Is there a way to yank the current word (in which the cursor resides) into a register? Currently, I do
        >
        > b"+ye
        >
        > --
        > --
        > 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.



        --
        http://www.cgtk.co.uk

        --
        --
        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.
      • A. S. Budden
        ... Oh, and it s also worth looking at aW and iW as well. Al -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply
        Message 3 of 6 , Jan 23, 2014
          On 23 January 2014 16:20, A. S. Budden <abudden@...> wrote:
          > On 23 January 2014 16:17, Paul <paul.domaskis@...> wrote:
          >> Is there a way to yank the current word (in which the cursor resides) into a register? Currently, I do
          >>
          >> b"+ye
          > "+yaw or "+yiw depending on how much you want to grab
          >
          > See :help aw and :help iw

          Oh, and it's also worth looking at aW and iW as well.

          Al

          --
          --
          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.
        • Paul
          ... Thanks, Al! -- -- 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
          Message 4 of 6 , Jan 23, 2014
            On Thursday, January 23, 2014 11:22:31 AM UTC-5, Al wrote:
            >On 23 January 2014 16:20, A. S. Budden <abuddenATgmail.com> wrote:
            >>On 23 January 2014 16:17, Paul <paul.domaskisATgmail.com> wrote:
            >>> Is there a way to yank the current word (in which the cursor
            >>> resides) into a register? Currently, I do
            >>>
            >>> b"+ye
            >>
            >> "+yaw or "+yiw depending on how much you want to grab
            >>
            >> See :help aw and :help iw
            >
            >Oh, and it's also worth looking at aW and iW as well.

            Thanks, Al!

            --
            --
            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.
          • Chris Lott
            ... What s the shortest/quickest way to grab the current word without changing the cursor position? c -- Chris Lott -- -- You received
            Message 5 of 6 , Jan 23, 2014
              On Thu, Jan 23, 2014 at 7:20 AM, A. S. Budden <abudden@...> wrote:
              > "+yaw or "+yiw depending on how much you want to grab


              What's the shortest/quickest way to grab the current word without
              changing the cursor position?

              c
              --
              Chris Lott <chris@...>

              --
              --
              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.
            • A. S. Budden
              ... Then you can use y. Explanation: mz - Mark current cursor position as z +yaw - Yank current word into clipboard `z - Go back to marked position Al --
              Message 6 of 6 , Jan 24, 2014
                On 23 January 2014 16:59, Chris Lott <chris@...> wrote:
                > On Thu, Jan 23, 2014 at 7:20 AM, A. S. Budden <abudden@...> wrote:
                >> "+yaw or "+yiw depending on how much you want to grab
                >
                >
                > What's the shortest/quickest way to grab the current word without
                > changing the cursor position?

                I don't know of a direct way, but I'd probably "cheat" and do this:

                :nmap \y mz"+yaw`z

                Then you can use \y.

                Explanation:

                mz - Mark current cursor position as 'z'
                "+yaw - Yank current word into clipboard
                `z - Go back to marked position

                Al

                --
                --
                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.