Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working in windows environment and is using gVim for usual editting. I want a simple way to copy text from vim to system buffer so I can Ctrl+V paste to other windows application.

I tried 'yy' and it didn't work. I hate to select the text by click-and-drag -> Ctrl+C because it make vim enter EDIT mode which I can't do search.

It there simple way to do this? Given that 'yy' only require me to press 2 keys, I want a solution within 2 keys too.

share|improve this question
    
"*y will put the selected text into clipboard buffer. 3 strokes though. –  longerstep Sep 20 '12 at 2:08
add comment

2 Answers 2

up vote 3 down vote accepted

If you want yy to copy into windows clipboard, add the following line to your vimrc

set clipboard=unnamed
share|improve this answer
add comment

Vim has a lot of different registers that are used by yank, delete, and put commands. By default, the unnamed register is used. There's another register, *, associated with the system clipboard. So the command you want is "*yy. Or you can make the unnamed register automatically use the clipboard by setting the clipboard option.

For more on registers: http://vimdoc.sourceforge.net/htmldoc/change.html#registers

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.