Thursday, September 9, 2010

Re: How to copy the name of the variable / function under the cursor?

Hi,

Dotan Cohen wrote:
> Is there a quick way to copy the name of the variable / function under
> the cursor (respecting word boundaries) to the clipboard without
> having to meticulously highlight and copy it in the regular fashion?

"+yiw

Note that this command will move the cursor to the start of the word.
If you don't want this, you can surround the command with commands to
save and restore the cursor position:

mp"+yiw`p

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

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

No comments:

Post a Comment