Monday, June 3, 2013

Re: Ctrl-r, Ctrl-w .. redo vs register

* Mercutio <sonny.chee@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

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: