Paste in command mode

0 views
Skip to first unread message

binxter

unread,
Apr 15, 2008, 5:52:31 PM4/15/08
to vim_use
I'm finding quite a few times that I'd like to paste text that I've
yanked in normal mode in command mode.
For example if I have the following string in my code

$rFile = fopen("dir1/dir2/dir3/dir4/file.txt");

I may want to edit a different file that exists in dir4. Currently the
way I find my self doing this is yanking the innerquote to the
clipboard register with the following commands:

"*yai"

Then I enter a colon ":" to get into command mode.
Then I type 'tabe' and use the mouse middle-click to paste the path. I
backout the basename and type the file I want to edit. Is there an
easier way to copy/paste in command mode? I feel like I'm missing
something. After searching for a bit I managed to figure out that I
can paste in insert mode using CTRL-R.

Any help would be much appreciated.
Thanks.

Benjamin Fritz

unread,
Apr 15, 2008, 6:12:14 PM4/15/08
to vim...@googlegroups.com

<C-R> works in command mode, too.

Registers of interest may be ", 0, 1, and of course * and +

See :help registers for a list of all the registers you can use.

binxter

unread,
Apr 15, 2008, 7:04:35 PM4/15/08
to vim_use
DOH! I can't believe I didn't try that!
Thanks!

On Apr 15, 4:12 pm, "Benjamin Fritz" <fritzophre...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages