Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I tried "+y and "*y but both doesn't seem to copy into the primary selection.

Note that vim --version returns -clipboard. Not sure what this means.
Also note that I'm running VIM in a terminal.

So how do I copy text into the Primary Selection in VIM?
Goal is to copy text from VIM into Google Chrome.

share|improve this question
If the output of vim --version returns -clipboard, that means that your vim installation doesn't include the clipboard feature. A + means that the feature is installed. – leemes May 11 '12 at 17:39
Ok. But it doens't mean that it cannot copy to the primary selection, right? – May 11 '12 at 17:41
I think you can't. AFAIK, "clipboard"/"primary selection" is a feature of the X server. Vim itself is a pure terminal application and has nothing to do with your X server. But I may be wrong in this point. – leemes May 11 '12 at 17:45
up vote 3 down vote accepted

You need a version of vim that has +clipboard in its version. Install the vim-gnome package and you should be fine. (And you don't have to use gvim to use the clipboard, it still works when running vim in a terminal.)

share|improve this answer
installing vim-gnome did it, even with -clipboard – May 11 '12 at 18:14

"+y uses a special register and is part of the clipboard feature of vim. Since your version of vim doesn't support clipboard (-clipboard means, clipboard feature isn't available), you need to use something else.

You can try this plugin, which doesn't depend on the clipboard feature and should work in the pure terminal version of vim. It seems that it depends on one of the programs screen, xclip, tmux.

share|improve this answer

Your Answer


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.