4

I read and tried several different solutions but I am still unable to copy from vim to system clipboard. Viceversa works, copying from outside vim and pasting with p is ok.

I have installed clipboard support, vim version is 7.3.429:

$ vim --version | grep clip
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments 
+xsmp_interact +xterm_clipboard -xterm_save 

I have:

set clipboard=unnamedplus

in my .vimrc and clipboard is set when I do:

set clipboard?

(that returns clipboard=unnamedplus) or

:echo has('clipboard')

:echo has('unnamedplus') returns 1

To copy from gvim to clipboard I am using:

yy
y
"*y
"+y

To paste I use Ctrl+V, Ctrl+Shift+V (in a terminal), but it doesn't work.

My vimrc is here (sorry for pastebin, it is too long to stay in this post)

Edit: copying to different instance of vim works, via the p shortcut. Otherwise it does not work.

I am using Ubuntu 12.04 LTS, and GVim. Any idea?

Thanks

7
  • 1
    What does ":echo has('unnamedplus')" show? Also, are you sure you want 'clipboard' to be set to "unnamedplus" and not just "unnamed"? What are you doing to try to copy to the clipboard?
    – Heptite
    Oct 21, 2013 at 20:57
  • I have updated my question
    – gc5
    Oct 22, 2013 at 7:26
  • What about "+y? What do you use to paste in other programs? <C-v>? Middle-click?
    – romainl
    Oct 22, 2013 at 7:54
  • It doesn't work.. I use Ctrl+V, Ctrl+Shift+V (in a terminal)..
    – gc5
    Oct 22, 2013 at 8:07
  • 1
    I have the same problem with my debian 7 server. I connect using SSH from my ubuntu desktop. On other (centos) servers vim copying works normally.
    – SPRBRN
    Oct 22, 2013 at 8:08

1 Answer 1

3

In my case, using Ubuntu 12.04, I found answer in this thread

Basically you have to install vim-gtk.

1
  • vim-gtk is installed. Vim has +clipboard. "+y and "*y don't affect the clipboard contents at all. (Ubuntu 18.04)
    – Tony
    Nov 1, 2018 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .