This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cygwin gvim needs weird ritual to past from Windows clipboard


Alan Thompson <thompson2526 <at> gmail.com> writes:
> Everything I said works both ways, both Cygwin->Windoze and
> Windoze->Cygwin.  The only difference in GVim is whether you use
> yank
> ("Y") or put ("P").  This works for both the win32 version of GVim
> and
> the Cygwin X11 version of GVim.  To be specific:
> 
>  - Highlight something in your browser and type Crtl-C
>  - Go into GVim and type "*P  (i.e. double quote-asterisk-capital
>  P).
> 
> GVim sees the windows clipboard as a special buffer named * (i.e.
> asterisk, star, whatever).  The double-quote references a buffer,
> star
> is the name of the buffer, and capital P means "put contents here".
> Of course, both yank and put have both uppercase versions (whole
> lines) and lowercase versions (partial lines).
> 
> Have you tried this?

Yes, I tried it for both PC-based gvim and Cygwin gvim on X11.  Both
work.  However, at the time, clicking middle button also worked in
pasting into gvim.  I will have to try again when middle button
doesn't work.

I have a gut feeling about a possible cause.  I find myself frequently
exasperated that the input keyboard changed from US to US -
International (which I use, but I want to use it only when I choose).
This random switch happens even though I disabled all hot keys for
keyboard language switching.  No amount of fuddling switches it back
sometimes, so I end up rebooting.  What an unbelievable pain.

Well.

The double-quote is treated as special for the International keyboard.
If middle-clicking somehow emulates a keyboard invocation of the vim
registers, then the emulation of a double-quote keystroke might be
part of that.  And if the double-quote is generated at a stage before
the keyboard language conversions, then it will be intercepted by the
keyboard language handlers and mangled.

It sounds like I'm grasping, but I didn't just dream this out of thin
air.  When I tried invoking the * register (actually, I like the +
register better since I already lift the pinky to get at the double
quote), gvim simply rings the error bell and bawks at me.  WTH, I
think, it's as if I'm entering illegal key combinations.  Well,
Windows randomly changes keyboard languages so often that it didn't
take too long for that to come under suspicion.  It was a simple test
on notepad to confirm that, yes, woops, Windows did it again (sounds
like a pop song).  And yes, a reboot was needed (though that's not
always the case).

I hope that this is somehow also the cause for the intermittent
problems in cutting and pasting by highlighting rather using vim
normal-mode yanks/cuts/deletes/puts.  I mean, even though it's a
bummer, at least I'll know what causes it, and a reboot isn't always
necessary (heck it's like playing Russion Roulette).  


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]