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

commented Mar 22, 2018

Thank you. This issue was driving me nuts.

@efidoman

This comment has been minimized.

Copy link

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

commented Apr 3, 2018

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

@thomskys

This comment has been minimized.

Copy link

commented Apr 5, 2018

Thanks a lot, very annoying feature.

@unixadmin-comcast

This comment has been minimized.

Copy link

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

commented May 11, 2018

Thank you

@lijonnas

This comment has been minimized.

Copy link

commented May 29, 2018

Thanks vm!

@pvint

This comment has been minimized.

Copy link

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

commented Jun 18, 2018

Thanks!!

@kogorman

This comment has been minimized.

Copy link

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

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

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

commented Sep 5, 2018

kurisushouri, thanks bro. Thank you so much.

@mrkeuz

This comment has been minimized.

Copy link

commented Sep 6, 2018

Thanks!

@minac

This comment has been minimized.

Copy link

commented Sep 7, 2018

thank you!

@aPollO2k

This comment has been minimized.

Copy link

commented Oct 4, 2018

Lol simple and powerfull. Thanks.

@nachopro

This comment has been minimized.

Copy link

commented Oct 13, 2018

Vielen dank!

@michield

This comment has been minimized.

Copy link

commented Oct 17, 2018

brilliant, thanks

@vitorlui

This comment has been minimized.

Copy link

commented Nov 9, 2018

You got a place in the heaven!

@rexave

This comment has been minimized.

Copy link

commented Nov 17, 2018

many thanks, hate this "feature" !!

@sarevok-anchev

This comment has been minimized.

Copy link

commented Dec 16, 2018

Whoever thought this was a sane default ....

Thanks for the solution!

@chris-gillatt

This comment has been minimized.

Copy link

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

commented May 15, 2019

100 thanks!

@pantuts

This comment has been minimized.

Copy link

commented May 24, 2019

Now im sane! THanks!

@aivanzipper

This comment has been minimized.

Copy link

commented May 29, 2019

Thank You!

@jansmets

This comment has been minimized.

Copy link

commented Jun 3, 2019

This visual mode is just awful. Please disable it !

@oioiben

This comment has been minimized.

Copy link

commented Jun 13, 2019

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

@arthurdamm

This comment has been minimized.

Copy link

commented Jun 21, 2019

Also, thank you!

@debugger2

This comment has been minimized.

Copy link

commented Jul 9, 2019

THKS!

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.