Loading ...
Sorry, an error occurred while loading the content.

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

Expand Messages
  • Christian Brabandt
    ... I honestly don t know. I thought, it works for all Cygwin versions. regards, Christian -- You received this message from the vim_use maillist. Do not
    Message 1 of 9 , Jan 22, 2013
    • 0 Attachment
      On Tue, January 22, 2013 09:36, Gary Johnson wrote:
      > On 2013-01-22, Christian Brabandt wrote:
      >> On Tue, January 22, 2013 06:03, AndyHancock wrote:
      >> > I installed cygwin's gvim on Windows 7. I found that pasting from the
      >> > Windows clipboard into gvim doesn't work by clicking the middle mouse
      >> > button unless I go through a weird ritual that I discovered by
      >> > accident. If I don't do this, I get "E353: Nothing in register *".
      > [...]
      >
      >> You might be interested in the cygwin_clipboard patch, that is floating
      >> around vim_dev and just recently was updated to work with recent Vim
      >> versions:
      >> http://groups.google.com/group/vim_dev/msg/b9fa96cceeb03518
      >>
      >> If you try the patch, please report there if it works or if you
      >> encounter
      >> some problems. This way, we might eventually get this patch included
      >> into Vim source.
      >
      > Andy can certainly try this patch, but I thought it applied only to
      > the Cygwin console vim.

      I honestly don't know. I thought, it works for all Cygwin versions.

      regards,
      Christian

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Andrew Hancock
      On Tue, Jan 22, 2013 at 1:58 AM, Tony Mechelynck ... I actually have the PC gvim as well as cygwin s. I switch over when I use a gvim buffer as a bash command
      Message 2 of 9 , Jan 22, 2013
      • 0 Attachment
        On Tue, Jan 22, 2013 at 1:58 AM, Tony Mechelynck
        <antoine.mechelynck_at_gmail.com> wrote:
        > On 22/01/13 06:03, AndyHancock wrote:
        >> I installed cygwin's gvim on Windows 7. I found that pasting from
        >> the Windows clipboard into gvim doesn't work by clicking the middle
        >> mouse button unless I go through a weird ritual that I discovered
        >> by accident. If I don't do this, I get "E353: Nothing in register
        >> *".
        >>
        >> First, I have to highlight some text using gvim.
        >>
        >> Second, I copy from Windows. Finally I paste into gvim using the
        >> middle mouse button (Shift-Insert never works).
        >>
        >> I am working in a locked down environment where arranging to run
        >> setup/install executables take months to arrange, and opening
        >> firewall ports might never happen. At first, I thought the problem
        >> might be related to an X11 error message about ports being blocked,
        >> but then I discovered the above recipe.
        >>
        >> Given the above clue, can anyone suggest what the cause might be,
        >> and possible ways to make the ritual unnecessary? Here is the
        >> diagnostic data that I am able to find.
        >
        > [...]
        >
        > As evidenced by your "version" listing, your Cygwin gvim is compiled
        > with GTK2 libraries to run under X11. As such its quote and plus
        > registers should be different, unlike what happens with
        > native-Windows builds of gvim. The middle mouse button accesses
        > register star, but Edit?Cut, Edit?Copy and Edit?Paste access
        > register plus. In any case, in order to paste the Windows clipboard
        > into Cygwin gvim, you need to make sure that at the moment you
        > paste, the Windows clipboard is reflected in either the X clipboard
        > (register +) or the X selection (register *). I'm not sure how to
        > accomplish this, since I never used Cygwin gvim: when I was on
        > Windows, I used native-Windows gvim, native-Windows console Vim, or
        > Cygwin console Vim, but I never ran X11. Nowadays I'm on Linux, and
        > of course there is no Windows clipboard on this machine.
        >
        > If you can't install a "proper" Windows gvim (such as the latest
        > version at http://sourceforge.net/projects/cream/files/Vim/ )
        > somewhere under your home directory (for instance if your sysadmin
        > runs a batch script every night to delete and report any unapproved
        > exe anywhere on the system), well, I guess you'll have to bone up on
        > Cygwin X11 documentation (wherever that can be found) in order to
        > find out how to make the X11 clipboard and/or the X11 selection
        > communicate with the Windows clipboard.

        I actually have the PC gvim as well as cygwin's. I switch over when I
        use a gvim buffer as a bash command console. I hack all sorts of
        compound bash statements, shell out to bash to generate text or file
        listings or to run commands, etc. Cygwin's gvim is indispensible for
        the bash interaction, but also because I don't have to constantly
        convert file paths between back- and forward slash. That can be
        extremely onerous.

        Thanks for the tidbit about the + and * registers. After reading
        vim's help, I know this is a long-term avenue of education. I can
        tell you that I've read and re-read X11 documentation over years (in
        the past) and it is still a mystery. I think it's one of those things
        in which you need to be deeply invested, and it must overlap a lot
        with one's career.

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Andrew Hancock
        On Tue, Jan 22, 2013 at 3:54 AM, Christian Brabandt ... The thread doesn t exactly describe the symptom being addressed. Since this is cygwin s gvim, I m
        Message 3 of 9 , Jan 22, 2013
        • 0 Attachment
          On Tue, Jan 22, 2013 at 3:54 AM, Christian Brabandt
          <cblists@...> wrote:
          > On Tue, January 22, 2013 09:36, Gary Johnson wrote:
          >> On 2013-01-22, Christian Brabandt wrote:
          >>> On Tue, January 22, 2013 06:03, AndyHancock wrote:
          >>> > I installed cygwin's gvim on Windows 7. I found that pasting
          >>> > from the Windows clipboard into gvim doesn't work by clicking
          >>> > the middle mouse button unless I go through a weird ritual that
          >>> > I discovered by accident. If I don't do this, I get "E353:
          >>> > Nothing in register *".
          >> [...]
          >>
          >>> You might be interested in the cygwin_clipboard patch, that is
          >>> floating around vim_dev and just recently was updated to work with
          >>> recent Vim versions:
          >>> http://groups.google.com/group/vim_dev/msg/b9fa96cceeb03518
          >>>
          >>> If you try the patch, please report there if it works or if you
          >>> encounter some problems. This way, we might eventually get this
          >>> patch included into Vim source.
          >>
          >> Andy can certainly try this patch, but I thought it applied only to
          >> the Cygwin console vim.
          >
          > I honestly don't know. I thought, it works for all Cygwin versions.

          The thread doesn't exactly describe the symptom being addressed.

          Since this is cygwin's gvim, I'm wondering if I should be considering a patch?

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Christian Brabandt
          Hi Andrew! ... Who knews, if nobody tries ;) Mit freundlichen Grüßen Christian -- Wie man sein Kind nicht nennen sollte: Anna Bolika -- You received this
          Message 4 of 9 , Jan 23, 2013
          • 0 Attachment
            Hi Andrew!

            On Mi, 23 Jan 2013, Andrew Hancock wrote:
            >
            > Since this is cygwin's gvim, I'm wondering if I should be considering a patch?

            Who knews, if nobody tries ;)

            Mit freundlichen Grüßen
            Christian
            --
            Wie man sein Kind nicht nennen sollte:
            Anna Bolika

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • AndyHancock
            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,
            Message 5 of 9 , Jan 24, 2013
            • 0 Attachment
              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).

              --
              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            Your message has been successfully submitted and would be delivered to recipients shortly.