Monday, October 4, 2010

Re: Buffers in command line?

On 2010-10-04, Ven Tadipatri wrote:
> Hi,
> I was wondering if there was a way to paste the contents of a
> buffer when in command line mode. For example, if I want to search for
> the word that I'm on, I was thinking of highlighting it in visual
> mode, yanking it into a buffer, then searching for what I yanked.

First off, in Vim, a buffer is the thing you edit, the in-memory
representation of a file. The thing you yank into and paste from is
called a register.

In answer to your question, yes, you can insert the contents of any
register into the command line by first typing Ctrl-R, then the name
of the register. Since the name of the default register is "
(double-quote), you could do what you want by yanking the word under
the cursor with

yiw

and pasting it at the desired point in the command line with

^R"

See

:help c_CTRL-R

Regards,
Gary

--
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

No comments:

Post a Comment