Thursday, October 7, 2010

Re: Clipboard functionality on Unix/Windows

On Thu, Sep 16, 2010 at 1:55 PM, Gary Johnson <garyjohn@spocom.com> wrote:
> On 2010-09-16, Ven Tadipatri wrote:
>> So after struggling for a while trying to integrate vi with the system
>> clipboard, I figured it out, and thought I might share it with others
>>
>> On Windows (from cygwin):
>> vmap <C-c> :<Esc>`>a<CR><Esc>mx`<i<CR><Esc>my'xk$v'y!cat >/dev/clipboard<CR>u
>>
>> On Linux machines (if you have xclip):
>> vmap <C-c> :<Esc>`>a<CR><Esc>mx`<i<CR><Esc>my'xk$v'y!xclip -selection c<CR>u
>
> If you have to do all that to copy from vim to the clipboard, your
> system is not properly configured.  It may be that the vi or vim

I have no clue how my system is configured, but I'm almost positive
that there's something wrong
with my vi setup.

> you're using was not built with support for X11 or the
> xterm_clipboard.  Some distributions come with a "vi" that is the
> tiny version of Vim, without support many features at all, and "vim"
> is often built without support for X11.  Try running Vim in a
> terminal as "gvim -v".  That will use the gvim binary, which does

Wow, thank you so much for that tip - You have no idea how many hours
I spent trying to get copy and paste to work. When I tried gvim -v, I
was able to access the +buffer to copy. Could you please add this to
the vim wiki, because I think it could seriously benefit a lot of
users.
Except now I have a slight problem that when I try to do shift+F4,
which I mapped to a shortcut, it prints out "2S" on the line. This
worked fine when I ran vi before, but it looks like some sort of weird
keymapping issue.
I hope the rest of the features work as expected. Does running gvim
-v require X11? I'm wondering if it will still work when I ssh into a
remote machine.


> have X11 support, but in console mode.
>
> Regards,
> Gary
>

Thanks,
Ven

--
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

No comments: