Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Im using Vim 7.3 in Ubuntu and I'm having a little problem copying to the system clipboard with the following command "+y but I'm getting the following error: E354: Invalid register name: '+'

In my vim --version, I see -xterm_clipboard. The option to copy is from mouse right click is also grayed out.

What steps do I need to take to enable the copying of text from my vim to the system clipboard?

share|improve this question
add comment

migrated from programmers.stackexchange.com Dec 3 '11 at 3:40

This question came from our site for professional programmers interested in conceptual questions about software development.

3 Answers

up vote 5 down vote accepted

Trivial problem, sir.

sudo aptitude install vim-gnome

which already comes pre-compiled with the +xterm_clipboard option.

On source-based distros like gentoo, you will have to compile the package with this USE flag specified.

share|improve this answer
add comment

For Arch Linux, install gvim. This also adds the missing feature to vim.

share|improve this answer
add comment

You should see +xterm_clipboard.

The simplest fix is to install a version of vim compiled with clipboard support. In Ubuntu, if you don't wish to build your own, you can install vim-gtk or vim-gnome, both of which have clipboard support.

share|improve this answer
add comment

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.