Server Fault is a question and answer site for system and network administrators. 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 found that I can not paste text to GVIM from firefox or other editor, anyone can tell me how to set my GVIM(GNOME) on Ubuntu11 ?

share|improve this question

The way I usually do this is to ensure that vim is in insert mode, select the text in Firefox (or whatever) and then middle click in vim - this is called the X11 selection, and is very handy.

You can also use the * and + buffers. So to paste from the X11 buffer into vim you can do (inside vim):


And if you have done Ctrl+C (or right click and "Copy") then you could do:


(Note that as usual, lower case p will paste after the cursor, and upper case P will paste before the cursor).

Note that "* and "+ work both ways. So if you have selected text in visual mode in vim, you can copy it to the X11 selection using "*y or to the standard clipboard using "+y.

share|improve this answer

I used "Shift-Insert" earlier today with text copied from firefox and pasted into a terminal (vi) for a co-worker stuck with the same issue on 11.. Not sure what needs to be changed in gvim to sync up the clipboards.

share|improve this answer

@Hamish's answer is nice and works fine for VIM. Another way, perhaps more general, is to use xclip (apt-get install xclip).

Run this (or, more realistically, bind it to some key):

 xclip -selection clipboard -o | xclip -selection primary -i

It will take your clipboard (where things end up after pressing ctrl-C, generally) and move it to your primary X selection (what you paste when you press the middle mouse button). So you can then press the middle mouse button to paste into VIM, GVIM or any other application.

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.