Super User is a question and answer site for computer enthusiasts and power users. 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

How do I make gvim ignore mouse clicks. I'm really sick of the trackpad making my cursor all over the place. I use xubuntu if that means anything.

share|improve this question
up vote 9 down vote accepted

I use:

:set mouse=c

This sets it to command-line mode. You can read about all of the options by typing,

:help mouse

To avoid needing to type the command each time, you can put it in your ~/.vimrc

share|improve this answer

As akira said, you can disable the mouse entirely, but you can also selectively disable mouse buttons by mapping them to <nop>. For example, if it is just a problem in insert mode, and just the left mouse button:

:imap <LeftMouse> <nop>

You can even do it for double clicks:

:imap <2-LeftMouse> <nop>


:help gui-mouse-mapping
:help map-overview
share|improve this answer
:set mouse=

see also:

share|improve this answer

I had same problem and though one can disable mouse/touchpad entirely there is a better solution: to disable touchpad while typing.

For Ubuntu there is a how-to.

share|improve this answer

I am using set so=1 in my .gvimrc or .vimrc under the gui section. The other ones are for Ctrl+C and Ctrl+V pasting, which is totally convenient in the gui.

if has('gui_running')
        vmap <C-c> "+yi
        vmap <C-x> "+c
        vmap <C-v> c<ESC>"+p
        imap <C-v> <C-r><C-o>+
        set so=1
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .