4

I've tried to copy text from Vim window to somewhere but it doesn't work. Decisions which I've found with google didn't help too. For instance, using the registers "* and "+.

Command vim version is (Ubuntu 12.04. Vim 7.3):

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

Can you help me to solve it? Should I use other vim version or are there any methods to copy text from Vim to something else?

migrated from stackoverflow.com Dec 5 '12 at 10:19

This question came from our site for professional and enthusiast programmers.

6

You might be using vim-tiny.

Do

$ vim --version | grep version

and report back the result.

If you are using "tiny", you should install a proper version.

Try

$ sudo apt-get install vim-nox

and/or

$ sudo apt-get install vim-gnome
  • I've installed vim-gnome and now Vim supports clipboard. "* and other methods is available. Thank you for the response! – edem Dec 3 '12 at 17:50
2

Better if you just install fuller version of vim with all necessary stuff compiled in. But if you can’t do this for some reason then you have at least two options: open file in something else (like gedit) and copy from there or use xclip or xsel to put required text to the clipboard. Example usage:

:'<,'>w !xclip -i

to send a visually selected range of lines to clipboard (by default: primary/mouse buffer referred as * in vim, use -sel clip additional arguments to change this to clipboard one referred as +) and

:call system('xclip -i', @")

to send a default (") register contents to clipboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.