Re: Ctrl-r, Ctrl-w not copying text to command line mode...

261 views
Skip to first unread message

Ben Fritz

unread,
Jun 3, 2013, 2:05:23 PM6/3/13
to vim...@googlegroups.com
On Monday, June 3, 2013 12:50:40 PM UTC-5, Mercutio wrote:
> Hey Guys,
>
> I would like to copy the word under my cursor to the command line. When I use the Ctrl-r, Ctrl-w combination, I get the following message on the status line:
>
> "Already at newest change."
>
> I checked my $HOME/.vimrc file and Ctrl-r is not mapped to anything and a find turned up no other .vimrc files....

You need to be in command-line mode for this to work.

From your error message, it looks like you tried it from normal mode. In normal mode, CTRL-R is "redo".

Mercutio

unread,
Jun 3, 2013, 2:13:16 PM6/3/13
to vim...@googlegroups.com

Aaah, yes. That's it. Thanks Fritz!

Sven Guckes

unread,
Jun 3, 2013, 2:16:32 PM6/3/13
to vim...@googlegroups.com
* Mercutio <sonny...@gmail.com> [2013-06-03 20:04]:
> I would like to copy the word under my cursor to the command line.
> When I use the Ctrl-r, Ctrl-w combination,
> I get the following message on the status line:
> "Already at newest change."
>
> I checked my $HOME/.vimrc file and Ctrl-r is not mapped
> to anything and a find turned up no other .vimrc files..

well, the CTLR-R (in command mode) is the "redo" command.
if you havent used "undo" previously then you are indeed at the
last change (aka "newest change") and there is nothing to redo.

see ":help CTRL-R" for more info on "redo".

i think you are mixing up modes here.
if want to use insert something using CTRL-R
then you must be in insert mode
(also within the command line).

try this:
first delete the current word with eg "diW"
(note the uppercase 'W' here) and then you
type ':' to switch to command line mode
and *then* you use the combination <CTRL-R><">
(CTRL-R followed by inverted commas)
to insert the last deletion
(from the "unnamed register").
bingo - deleted word inserted! :-)

when editing a text you may also enjoy
entering text of the following registers:
% # * = / : . - and =

see ":help i_CTRL-R" for more info on this.
(note the prefix "i_" here as described
on the first page of ":help" ;)

Sven
Reply all
Reply to author
Forward
0 new messages