Discussion:
vim: substitute word under cursor
(too old to reply)
v***@gmail.com
2007-04-10 15:26:10 UTC
Permalink
Does anybody know how to substitute a word under my current cursor
position in vim?

Thank you!
Jean-Rene David
2007-04-10 15:39:05 UTC
Permalink
Post by v***@gmail.com
Does anybody know how to substitute a word under my
current cursor position in vim?
:s/<C-R><C-W>/replacement text/

<C-R><C-W> will put the word under the cursor on the
command-line.
--
JR
v***@gmail.com
2007-04-10 16:03:57 UTC
Permalink
Post by Jean-Rene David
Post by v***@gmail.com
Does anybody know how to substitute a word under my
current cursor position in vim?
:s/<C-R><C-W>/replacement text/
<C-R><C-W> will put the word under the cursor on the
command-line.
--
JR
It works! Thank you!
Jean-Rene David
2007-04-10 19:19:01 UTC
Permalink
Post by v***@gmail.com
Does anybody know how to substitute a word under my current cursor
position in vim?
Another way, just type "ciw" in normal mode. "iw" is an
object selection command which means "inner word".

:h object-select
--
JR
Continue reading on narkive:
Loading...