Last active
December 3, 2024 01:44
-
-
Save u0d7i/01f78999feff1e2a8361 to your computer and use it in GitHub Desktop.
Disable vim automatic visual mode on mouse select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Disable vim automatic visual mode on mouse select | |
issue: :set mouse-=a | |
add to ~/.vimrc: set mouse-=a | |
my ~/.vimrc for preserving global defaults and only changing one option: | |
source $VIMRUNTIME/defaults.vim | |
set mouse-=a |
on debian 11 we're now using the following /etc/vim/vimrc.global to disable the mouse integration by default for all users:
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
let skip_defaults_vim=1
set mouse&
without @TheSpyder's hint, it didn't work with "set mouse=-a".. so thank you very much :D!
Thank you. The trick is to disable the mouse support for Vim. I achieved this by adding the following to the /etc/vim/vimrc
file.
I had to add syntax on
to enable syntax highlighting.
set mouse=
syntax on
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
None of this was working for me without
skip_defaults_vim
, which disables other things I wanted. But looking updefaults.vim
https://github.com/vim/vim/blob/6c1afa3d0bdfce3ac1197b00409ac1afa7cf368a/runtime/defaults.vim#L80-L81
... the intent of the vim authors is just type
:
and visual selection is disabled! That's a start.then I noticed, near the top of the file, the recommended way to revert settings is
:set option&
. So if I useset mouse&
instead ofset mouse-=a
now things work as described.VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 04 2023 10:24:44)