command to paste into ex

1 view
Skip to first unread message

fREW Schmidt

unread,
Nov 20, 2008, 3:34:45 PM11/20/08
to vim...@googlegroups.com
Hello All,

At some point I knew a command that you could use to paste visually selected text (or something along those lines) into the ex command box.  I couldn't find it in the docs but I presume I didn't know where to look.  Any tips?


Thanks!
-fREW

Mr. Shawn H. Corey

unread,
Nov 20, 2008, 3:51:58 PM11/20/08
to vim...@googlegroups.com

I not sure what an ex command box is but to paste the contents of the
clipboard into an ex command (also called the colon command line):

^R+

Note that some applications use the * buffer for the clipboard so the
command becomes:

^R*


--
Just my 0.00000002 million dollars worth,
Shawn

The map is not the territory,
the dossier is not the person,
the model is not reality,
and the universe is indifferent to your beliefs.

Tim Chase

unread,
Nov 20, 2008, 4:11:26 PM11/20/08
to vim...@googlegroups.com

as far as I know, there's no command to bring in the visually
selected text *without yanking first*. However, once you have it
yanked into a register, you can do as Shawn suggested with the
control+R followed by the register identifier

:help c_CTRL-R

-tim


fREW Schmidt

unread,
Nov 20, 2008, 4:34:12 PM11/20/08
to vim...@googlegroups.com
Thanks, both of you!

What about going (almost) the other direction; I typically type a search with / when I mean to do :s/.  Is there a way to fix that?

-fREW

Gary Johnson

unread,
Nov 20, 2008, 4:58:09 PM11/20/08
to vim...@googlegroups.com

Sure. The last search string is saved in the / register, so after
you've typed

:s/

you can then type Ctrl-R followed by / and your search string will
appear after the :s/. See also

:help quote/

Regards,
Gary

fREW Schmidt

unread,
Nov 20, 2008, 5:22:26 PM11/20/08
to vim...@googlegroups.com

Awesome!

Thanks Gary.
-fREW
Reply all
Reply to author
Forward
0 new messages