I am using Vim 7.3.829 on Windows 7, how can I disable the scroll wheel completely in the settings of Vim?

  • Try :set mouse= – FDinoff Jun 23 '13 at 3:23
  • 1
    The scroll wheel is hard-coded on Windows, so you cannot map it and 'set mouse' does nothing I've discovered. – Shane Thornton Jun 23 '13 at 7:48
  • On every platform, set mouse affects only pointing and clicking, not the scroll wheel. – poolie Jan 14 '18 at 17:21

You need to map the various scroll wheel events to <nop>:

:nmap <ScrollWheelUp> <nop>
:nmap <S-ScrollWheelUp> <nop>
:nmap <C-ScrollWheelUp> <nop>
:nmap <ScrollWheelDown> <nop>
:nmap <S-ScrollWheelDown> <nop>
:nmap <C-ScrollWheelDown> <nop>
:nmap <ScrollWheelLeft> <nop>
:nmap <S-ScrollWheelLeft> <nop>
:nmap <C-ScrollWheelLeft> <nop>
:nmap <ScrollWheelRight> <nop>
:nmap <S-ScrollWheelRight> <nop>
:nmap <C-ScrollWheelRight> <nop>

Then copy and paste those lines and change "nmap" to "imap", and then do it again for "vmap".


:help scroll-mouse-wheel
:help <nop>

And if you are unfamiliar with mappings:

:help map.txt
| improve this answer | |

You can unmap these,

   :map <ScrollWheelUp> <C-Y>
   :map <S-ScrollWheelUp> <C-U>
   :map <ScrollWheelDown> <C-E>
   :map <S-ScrollWheelDown> <C-D>

Ref: vimdoc Scrolling with a mouse wheel.

There should also be a single configuration, but I can't seem to locate it at this time.

| improve this answer | |
  • Upvoted this for the doc link, but note that people actually want the opposite of the commands shown here: they should remap these to <nop> as shown in the other answer. – poolie Jan 14 '18 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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