Disabling Right Click Visual Mode on VIM editor

Every once in a while software developers do dumb things. I found this to be the case with a new ‘feature’ of the VIM editor where a right click brings up the visual mode of the vim editor. I hate this. Pressing ‘v’ is easy enough for me if I need to enter visual mode. To boot, this functionality made pasting from an external source much more difficult. There are a lot of ways to disable this feature, but my preferred method is to create a line item in my users .vimrc file like this:

touch ~/.vimrc
echo "set mouse-=a" > ~/.vimrc
source ~/.vimrc

*Note that you only need to enter the first command if your user does not already have a .vimrc file.*

3 thoughts on “Disabling Right Click Visual Mode on VIM editor

  1. touch ~/.vimrc is not required. You can just do echo set mouse-=a > ~/.vimrc without the double-quotes. However, this is very dangerous since it would overwrite an existing vimrc completely. Please change it to echo set mouse-=a >> ~/.vimrc to prevent people from deleting their vimrc.

    1. It’s possible you removed your theme color setting from your vimrc file as noted below, you may need to add that back in…

Leave a Reply

%d bloggers like this: