I tried to paste what I copied in windows clipboard into cygwin's vi or emacs, and it doesn't seem to work with yy (vi) or M-w (emacs).

Is there a way to do it? I learned that /etc/clipboard has the clipboard data from windows, but I don't know how to get this info in vi or emacs.

link|improve this question

74% accept rate
feedback

2 Answers

At least for vim, the clipboard is the "* register.

So, to yank the current line, go "*yy, to paste in the contents of the clipboard, go "*p, so on and so forth.

link|improve this answer
I tried, but it doesn't work. Thanks for the answer though. – prosseek Jul 6 '11 at 14:49
@prosseek; Oh. Well, FWIW, it works in both gvim and the version of vim that comes with it - you could consider using those over cygwin's? – Phoshi Jul 6 '11 at 15:11
feedback

To paste from the clipboard using vi in Cygwin:

Press SHIFT-INSERT in insert mode

(this means the insert key by the Delete/Home/End keys)

To copy to the clipboard using vi in Cygwin:

When you select text with your mouse, it automatically gets copied to the clipboard.

You can paste from the clipboard by pressing the middle mouse button.

Also, in some environments where "*yy doesn't work, you can try "+yy.

Unfortunately this does NOT work in Cygwin.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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