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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Paul-2
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

A. S. Budden
"+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 <[hidden email]> 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 [hidden email].
> 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

A. S. Budden
On 23 January 2014 16:20, A. S. Budden <[hidden email]> wrote:
> On 23 January 2014 16:17, Paul <[hidden email]> 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

Paul-2
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

Chris Lott
In reply to this post by A. S. Budden
On Thu, Jan 23, 2014 at 7:20 AM, A. S. Budden <[hidden email]> 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 <[hidden email]>

--
--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

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

A. S. Budden
On 23 January 2014 16:59, Chris Lott <[hidden email]> wrote:
> On Thu, Jan 23, 2014 at 7:20 AM, A. S. Budden <[hidden email]> 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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.