Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 recently upgraded myself to gvim7.3 (from gvim7.2) and I've lost my middle-mouse button paste functionality.

Note: This problem is only in gvim, my vim works as expected.

What magic stuff should I put in my vimrc to get the awesome functionality back?

share|improve this question

What did you do to upgrade? Did you install your distribution's latest gvim package in place of the same distribution's earlier gvim package? Did you build it yourself? Did you upgrade both gvim and vim?

If the upgrade didn't change your vimrc, then there is no reason to believe that changing your vimrc will fix the problem.

In a terminal, start gvim like this:

gvim -N -u NONE

That will ignore all of your configuration files. Copy some text from somewhere, move your mouse to the gvim window and click the middle mouse button. It should paste whatever you copied. If it didn't, there is something wrong with your build of gvim. Clues may be found in the output of


If the paste did work, then the problem is in your configuration. Make sure when you run gvim normally that

:verbose set mouse?

prints "mouse=a". If it doesn't, it will tell you where the value of the 'mouse' option is being changed.

To verify that gvim is seeing your middle mouse click, you can put gvim into insert mode (e.g., type o) then type Ctrl-V and click the middle mouse button. Gvim should insert the text "<MiddleMouse>".

If that doesn't reveal the problem, let me know the results and we'll go from there.

share|improve this answer
:verbose set mouse? says mouse=a and Ctrl-V Middle Mouse says <MiddleMouse> – Jeffrey Jose May 18 '11 at 4:27
oh, I should clarify that "Ctrl-C" copy and "middle mouse" works. Its the "select to copy", "middle mouse" that stopped working all of a sudden. – Jeffrey Jose May 18 '11 at 4:30
Do you mean that dragging the mouse over some text in gvim to select it, then middle-clicking the mouse somewhere else in gvim no longer pastes it? Could you give me some sequence of steps that no longer work as you expect, starting from gvim -N -u NONE so that I can understand the problem better and can try to reproduce it myself? – garyjohn May 18 '11 at 6:08
I just fired up gvim 7.2.148 and gvim 7.3.189 on Fedora 11 with -N -u NONE and successfully used the left mouse button to select text and the middle mouse button to paste it, both within each gvim instance and between them. So with no configuration files, selecting and pasting seems to work fine on both 7.2 and 7.3. – garyjohn May 18 '11 at 16:38

I had a similar problem with the middle mouse button suddenly not pasting in vi. Following the advice above, I was able to paste normally when starting vi with the -N -u switches, so I edited my .vimrc file and commented out

set mouse=a

Doing so brought back the desired paste functionality for me.

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.