Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
@fhaist

This comment has been minimized.

Copy link

fhaist commented Mar 22, 2018

Thank you. This issue was driving me nuts.

@efidoman

This comment has been minimized.

Copy link

efidoman commented Mar 31, 2018

Yes, thanks so much. ssh vi copy/paste was almost impossible for me without this change.

@dbdq

This comment has been minimized.

Copy link

dbdq commented Apr 3, 2018

Thanks for solving this issue. This "feature" was extremely counter-productive.

@thomskys

This comment has been minimized.

Copy link

thomskys commented Apr 5, 2018

Thanks a lot, very annoying feature.

@unixadmin-comcast

This comment has been minimized.

Copy link

unixadmin-comcast commented Apr 22, 2018

I thought the 'compatible' option was on by default, obviously it may have changed in some releases. So if you prefer more of a static/generic old-school Vi experience from Vim in general consider that you can also manually set the 'compatible' option. This might help you to avoid spending a lot of time learning (or turning off) new Vim 'features' as they crop up with every release...

echo :set compatible > ~/.vimrc

from within Vim you can check to see the current status of the compatible option...

:verbose set compatible?

this will also indicate indicate what specific configuration file the option was set from

@vognition

This comment has been minimized.

Copy link

vognition commented May 11, 2018

Thank you

@lijonnas

This comment has been minimized.

Copy link

lijonnas commented May 29, 2018

Thanks vm!

@pvint

This comment has been minimized.

Copy link

pvint commented Jun 12, 2018

I always forget how to do this and whenever I do a fresh install on a Raspberry Pi I hit this and this is my go-to quick reference.
Thanks!

@virgilioneto

This comment has been minimized.

Copy link

virgilioneto commented Jun 18, 2018

Thanks!!

@kogorman

This comment has been minimized.

Copy link

kogorman commented Jun 28, 2018

It's not so much that I want a Vi experience, although I learned editing with Vi starting around 1985. I don't want compatible mode, for sure. But when I'm editing in a terminal I want to be able to use the mouse to highlight things without getting Vim involved, so that I can copy/paste to other apps.

I have never intentionally used visual mode in vim, and am uncertain why I ever would.

@jaimet561

This comment has been minimized.

Copy link

jaimet561 commented Sep 5, 2018

What to do if you installed VIM 8 by source?
Which, currently is my situation. I installed VIM 8 by source. How can i disable Visual mode on mouse select?
I do not have ~/.vimrc

@kurisushouri

This comment has been minimized.

Copy link

kurisushouri commented Sep 5, 2018

jaimet561, if you don't have ~/.vimrc, do the following:

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

What this does is creates the .vimrc file in your home directory, overwrites the (empty) file with the echo statement, and sources the file to load the contents (makes it take effect).

@jaimet561

This comment has been minimized.

Copy link

jaimet561 commented Sep 5, 2018

kurisushouri, thanks bro. Thank you so much.

@mrkeuz

This comment has been minimized.

Copy link

mrkeuz commented Sep 6, 2018

Thanks!

@minac

This comment has been minimized.

Copy link

minac commented Sep 7, 2018

thank you!

@aPollO2k

This comment has been minimized.

Copy link

aPollO2k commented Oct 4, 2018

Lol simple and powerfull. Thanks.

@nachopro

This comment has been minimized.

Copy link

nachopro commented Oct 13, 2018

Vielen dank!

@michield

This comment has been minimized.

Copy link

michield commented Oct 17, 2018

brilliant, thanks

@vitorlui

This comment has been minimized.

Copy link

vitorlui commented Nov 9, 2018

You got a place in the heaven!

@rexave

This comment has been minimized.

Copy link

rexave commented Nov 17, 2018

many thanks, hate this "feature" !!

@sarevok-anchev

This comment has been minimized.

Copy link

sarevok-anchev commented Dec 16, 2018

Whoever thought this was a sane default ....

Thanks for the solution!

@chris-gillatt

This comment has been minimized.

Copy link

chris-gillatt commented Jan 5, 2019

Make sure you add the same entry as the root user too, otherwise when you sudo you'll go back to Old Kent Road.

@jenlampton

This comment has been minimized.

Copy link

jenlampton commented May 15, 2019

100 thanks!

@pantuts

This comment has been minimized.

Copy link

pantuts commented May 24, 2019

Now im sane! THanks!

@aivanzipper

This comment has been minimized.

Copy link

aivanzipper commented May 29, 2019

Thank You!

@jansmets

This comment has been minimized.

Copy link

jansmets commented Jun 3, 2019

This visual mode is just awful. Please disable it !

@oioiben

This comment has been minimized.

Copy link

oioiben commented Jun 13, 2019

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

@arthurdamm

This comment has been minimized.

Copy link

arthurdamm commented Jun 21, 2019

Also, thank you!

@debugger2

This comment has been minimized.

Copy link

debugger2 commented Jul 9, 2019

THKS!

@ade951

This comment has been minimized.

Copy link

ade951 commented Aug 7, 2019

Yes, thanks so much. ssh vi copy/paste was almost impossible for me without this change.

+1.
And the reverse operation is issuing :set mouse+=a

@kirklatslalom

This comment has been minimized.

Copy link

kirklatslalom commented Aug 14, 2019

Whoever thought this was a sane default ....
I always forget how to do this and whenever I do a fresh install on ...
This issue was driving me nuts.
+1

Thanks!

@cpu100

This comment has been minimized.

Copy link

cpu100 commented Aug 26, 2019

Oh no, the theme color is gone too.

@cpu100

This comment has been minimized.

Copy link

cpu100 commented Aug 26, 2019

syntax enable
set mouse-=a 
@huaius

This comment has been minimized.

Copy link

huaius commented Sep 5, 2019

Helped a lot!

@tehsunnliu

This comment has been minimized.

Copy link

tehsunnliu commented Sep 10, 2019

syntax enable
set mouse-=a

Thanks. Only setting mouse-=a removed syntax.
Also, backspace stopped working.

set bs=2

@ghuls

This comment has been minimized.

Copy link

ghuls commented Sep 30, 2019

To use normal mouse behavior when this option is enabled, press SHIFT while pressing mouse buttons.

@kasumiru

This comment has been minimized.

Copy link

kasumiru commented Oct 28, 2019

In all docker, in all users on all servers
*sad kitty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.