A problem that bothers much my editing work with vim happens when pasting text and the mouse wheel rotates slightly by accident with the result that text is inserted elsewhere in the file under edition.

I tried to remove this behavior by including

set mouse=""

in my ~/.vimrc but the annoying behavior remains.

Is there perhaps another variable that controls the mouse behavior?

  • You can undo by pressing u.
    – SibiCoder
    Jun 3, 2016 at 3:52
  • Another way is to check with an autocommand
    – SibiCoder
    Jun 3, 2016 at 3:52
  • in Insert mode, it doesn't matter where your mouse is pointing.. it will paste where the cursor is
    – Sundeep
    Jun 3, 2016 at 5:16
  • 1
    Simple: don't paste with the mouse.
    – romainl
    Jun 3, 2016 at 5:17
  • 2
    You could disable the mousewheel scrolling action, with :map <ScrollWheelUp> <Nop> etc.
    – JigglyNaga
    Jun 3, 2016 at 10:21

1 Answer 1


I couldn't find a specific setting for disabling the wheel while leaving the other mouse features active, but as a workaround, you could map wheel events to do nothing:

map <ScrollWheelUp> <Nop>
map <ScrollWheelDown> <Nop>

You may also need to disable the shift- and control-modified events, and Left and Right if you have a device that sends those. See :help scroll-mouse-wheel for a complete list of the default bindings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.