Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

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

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

2 Answers 2

up vote 6 down vote accepted

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
share|improve this answer
    
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

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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