Monday, May 6, 2024
112
rated 0 times [  112] [ 0]  / answers: 1 / hits: 58906  / 2 Years ago, tue, august 23, 2022, 3:18:31

I am 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 it is set when I do:


set clipboard?

or


:echo has('clipboard')

I am using Ubuntu 12.04 LTS, and vim inside gnome-terminal (but also GVim has the same problem). Any idea?


More From » command-line

 Answers
6

This is what works for me (Ubuntu 13.10):



Reinstall vim as vim-gtk:



sudo apt-get install vim-gtk


select what you want using the mouse - then type to copy to clipboard:



"+y


to paste to vim from clipboard type:



"+p


I don't know why but comparing the output of vim --version shows that the usual vim installation is quite restricted compared to vim-gtk. Replacing vim with vim-gtk did not affect any plugings.






Further information:




[#29365] Wednesday, August 24, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
oneeme

Total Points: 340
Total Questions: 110
Total Answers: 133

Location: Ghana
Member since Fri, Oct 21, 2022
2 Years ago
;