I am curious if there are (possibly built-in) commands for these
tasks:
1) yank the *complete* word under the cursor (yw does work only if the
cursor is in the first pos of the word)
2) delete the *complete* word (like above)
3) paste the word under the cursor into the command line, e.g. as part
of a for a complex substitution (to evoid retyping it)
Thank You
Felix
yaw
yiw
The first yanks "a word" including trailing white space. The second
yanks the "inner word" not including trailing white space. See
:help text-objects
for more on these and other related text objects.
> 2) delete the *complete* word (like above)
The same principle applies, just the command is different:
daw
diw
> 3) paste the word under the cursor into the command line, e.g. as part
> of a for a complex substitution (to evoid retyping it)
As you type in the command line, type Ctrl-R followed by Ctrl-W to
insert the word under the cursor. See
:help c_CTRL-R_CTRL-W
for more on this and
:help c_CTRL-R
for other things you can insert into the command line.
Regards,
Gary
yiw
yank inner word (without the surrounding spaces or punctuation)
>
> 2) delete the *complete* word (like above)
daw
delete a word (with the surrounding space on _one_ side)
>
> 3) paste the word under the cursor into the command line, e.g. as part
> of a for a complex substitution (to evoid retyping it)
Ctrl-R Ctrl-W
see
:help objects
:help c_CTRL-R_CTRL-W
>
> Thank You
> Felix
My pleasure,
Tony.
--
"I am not an Economist. I am an honest man!"
-- Paul McCracken