History
Article Edit this page Discussion

Easy pasting to Windows applications

From Vim Tips Wiki

(Redirected from VimTip21)
Jump to: navigation, search

[edit] Duplicate tip

This tip is very similar to the following:

These tips need to be merged – see the merge guidelines.

Tip 21 Previous Next Created: February 25, 2001 Complexity: basic Author: jean Version: 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

[edit] Comments

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.


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. Then:

:let @*=@a

This puts both lines into the * buffer for pasting.


This tip, set clipboard=unnamed, also works under the X windowing system.

BenArmston 09:52, 23 May 2008 (UTC)


Rate this article:

Share this article:

Hubs Highlights International Sites Wikia messages
Entertainment
Gaming
Cartoons & Comics
Science Fiction
Hobbies
Sports
See all...
Grand Theft Auto
Pixar
Legend of Zelda Wiki
Terminator Wiki
Everquest II Wiki
Dark Shadows
German
Spanish
Chinese
Japanese
More...
Wikia is hiring for several open positions


Vote for collaboration of the month.

Send this article to a friend
"Easy pasting to Windows applications"
 
 
Hi!

I thought you'd like this page from Wikia!

http://vim.wikia.com

Come check it out!
Send confirmation