Osho GG wrote:
Hi All,
I know this mustbe pretty simple but I can't figure this out. I want
to copy a word into a buffer without moving the cursor. Currently I do
something like
*"ayw^O:noh<CR>
to get this effect. But, this seems like such a round about way to do
this. Is there a simpler way to achieve this?
thanks,
Osho
"ayaw should yank (into register a) the word nearest the cursor (with the
whitespace on one side of it: use yiw [yank inner word] instead of yaw [yank a
word] to avoid yanking the whitespace); however, IIUC it sets the cursor at
the start of the word. You may follow it with <Home> if you want to go to the
start of the line.
See ":help text-objects"
Best regards,
Tony.