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

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

Expand Messages
  • Andrew Hancock
    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
    • Show all 9 messages in this topic