It's nice to be able to type
* in normal mode and automatically have Vim search for the word under the cursor.
Is there an analogous command for executing a find/replace?
E.g. the cursor is on "the" and the result is
:%s/\<the\>/ so that I can easily type
the only/g for the full find/replace command
I have learned from a comment on this question that a solution might involve, to quote that comment,
:command-line to insert the word (respectively the WORD) under the cursor.
This certainly works and could be used to write a custom command to do what I am asking (e.g.,
nnoremap ** :%s/<c-r><c-w>).
Is that the best way to do this? Or is there a native Vim command that already does what I am looking for?