On 2006-11-08, Chuck Mason <[EMAIL PROTECTED]> wrote:
> Say cursor is highlighting a word <cword>, and I want to replace
> this word with something else everywhere in the file. My "ideal"
> solution would be:
>
> :%s/<cword>/something/g
>
> But we all know that won't work. So maybe there's a way to insert
> the current word in the current buffer into the command mode line?
> Anyone have a solution? I'd prefer something where I don't have
> to make a keymapping or create a function so I can use this trick
> on a clean install.
Type
:%s/^R^W/something/g
where
^R is Ctrl-R
^W is Ctrl-W
See
:help c_CTRL-R_CTRL-W
and
:help c_CTRL-R
for other things you can insert on the command line this way.
HTH,
Gary
--
Gary Johnson | Agilent Technologies
[EMAIL PROTECTED] | Wireless Division
| Spokane, Washington, USA