Monday, January 27, 2014

RE: How to disable mouse scroll wheel when in insert mode?

Thanks for the replies but I am not having luck with the mappings.
When I am in INSERT mode the mouse wheel still works.
FYI I am in a gnome-terminal when I use vi, although I would not
think this should matter.

Interestingly I was able to 'disable' the mouse wheel for 'normal' mode only using

:nmap <MouseScrollWheelUp> <nop>

which looks like this on my screen :nmap ^[OA <nop>
and of course the MouseScrollWheelDown (which is ^[OB ) too.

Once I executed those 2 nmap commands in my vi session, I could no longer
move the cursor with the mouse's scroll wheel. It would be fantastic if
I could get this same behavior when I am in insert mode.

So next I tried the same technique with all the other 'map' commands,
using 'imap' for insert, 'map!', 'vmap', .... etc. And again, the ONLY
mode in which the scroll wheel was disabled was the 'normal' mode.

Thanks for any suggestions,
-Glenn


-----Original Message-----
From: vim_use@googlegroups.com [mailto:vim_use@googlegroups.com] On Behalf Of Marcin Szamotulski
Sent: Sunday, January 26, 2014 5:43 AM
To: vim_use@googlegroups.com
Subject: Re: How to disable mouse scroll wheel when in insert mode?

On 19:16 Sat 25 Jan , John Little wrote:
> On Sunday, January 26, 2014 7:46:17 AM UTC+13, Israel Chauca F. wrote:
>
> > The following mappings seem to do the trick...
>
> I know the OP is on CentOS, but FWIW the mappings don't work on Windows; the mouse wheel handling is hard-coded there.
>
> Regards, John Little

They work on Linux.

Regards,
Marcin

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: