sponsor Vim development Vim logo Vim Book Ad

basic Tip #21: easy pasting to windows apps

 tip karma   Rating 199/87, Viewed by 7582 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   February 25, 2001 22:31      complexity:   basic
author:   [email protected]      as of Vim:   5.7

In Vim, the unnamed register is the " register, and the Windows
Clipboard is the * register. This means that if you yank something,
you have to yank it to the * register if you want to paste it into
a Windows app. If this is too much trouble, set the 'clipboard'
option to 'unnamed'. Then you always yank to *.

So pasting to windows apps doesn't require prefixing "* :

  set   clipboard=unnamed

 rate this tip  Life Changing Helpful Unfulfilling 

<< Are *.swp and *~ files littering your working directory? | handle common typos for :commands >>

Additional Notes

[email protected], March 4, 2001 11:27
You can also have the Visual selection automatically copied to the clipboard.  If you

:set go+=a

and then make a Visual selection, you can switch to another application (such as your mail reader) and paste.

:help guioptions
:help quotestar
[email protected], October 28, 2001 17:34
Since the * buffer won't allow (as far as I know anyway) appending to it, you also do something like:

"aY
to grab a line then move somewhere else
"AY
to append another line to the a buffer and then finally:

:let @*=@a

This puts both lines into the * buffer for pasting. I picked this up on the vim email list I think from Benji.

Scott LaBounty
Netaphor Software, Inc.
[email protected], November 15, 2004 1:57
thats not to the help of the schools internet, so more information would help a lot,,............
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
SourceForge.net Logo