-
-
Save u0d7i/01f78999feff1e2a8361 to your computer and use it in GitHub Desktop.
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 |
This way ends with text copied to clipboard with line numbers, Of course if you have one window vertically.
Instead I used to this option.
JUST HOLDSHIFT KEY
DURING SELECTING TERMINAL TEXT TO BEHAVE LIKEset mouse-=a
In MacOSX with Iterm2, you would use ALT key instead of SHIFT.
Ye who muck with 'vi' shall be anathema forever!
use the shift yourself, and return me as it was before. without fu "hotfix" echo 'set mouse -=a' >> ~/.vimrc
Thanks a lot, very annoying "feature".
use the shift yourself, and return me as it was before. without fu "hotfix"
echo 'set mouse -=a' >> ~/.vimrc
Thanks a lot, very annoying "feature".
I was working with RHEL servers for 8 years and now with the news about widthrawing CentOS after it's been sold to IBM - I am setting up debian servers around. GOD was I furious with vim there.
So while looking through the ways of installing vim 2.7 instead of 2.8, I found this one:
https://github.com/neovim/neovim/wiki/Installing-Neovim
Guess what:
alias vi='nvim'
alias vim='nvim'
No more pain!
This helped me instead:
set mouse=
set ttymouse=
thanks 🐧
Thanks, whoever changed this setting almost changed me to prefer nano.
Thanks
Thanks. Was driving me crazy
Driving me crazy as well — Does one need to reboot in order for the root change to be accepted? Changed it, and I'm still in visual mode when attempting cpy/paste while using sudo.
In current editing session just use
:set mouse-=a
If you want it to persist, put it into .vimrc as descibed above. If you only put it in .vimrc it won't take affect until you restart vim
set mouse-=a worked for me, thumbs up!
I did have to add "syntax on" in my .vimrc, but then it all worked like a charm.
This has helped. Thanks
It still doesn't work as expected. If I change the parameter in /usr/share/vim/vim82/defaults.vim then it is removed after vim update. Changes to /etc/vim/vimrc don't work either. The only solution is to add parameters to ~ /.vimrc for each user. It blows my mind.
to not lose the defaults.vim just put this at the top of your ~/.vimrc
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
this will survive vim upgrades
It still doesn't work as expected. If I change the parameter in /usr/share/vim/vim82/defaults.vim then it is removed after vim update. Changes to /etc/vim/vimrc don't work either. The only solution is to add parameters to ~ /.vimrc for each user. It blows my mind.
If the set mouse=
is not in ~/.vimrc
, then you need another line for it: let skip_defaults_vim=1
in /etc/vim/vimrc
.
This is the most annoying thing, there is no reason for this. Most useless thing, should not be default.
Thanks, you're the OG
If only this worked for IdeaVim. What a pain.
Thank you so much !! ^_^
This way ends with text copied to clipboard with line numbers, Of course if you have one window vertically. Instead I used to this option. JUST HOLD
SHIFT KEY
DURING SELECTING TERMINAL TEXT TO BEHAVE LIKEset mouse-=a
This only works in Xterm AFAIR
thank you so much :-)
This way ends with text copied to clipboard with line numbers, Of course if you have one window vertically. Instead I used to this option. JUST HOLD
SHIFT KEY
DURING SELECTING TERMINAL TEXT TO BEHAVE LIKEset mouse-=a
Thanks a lot, this is saving life!
This way ends with text copied to clipboard with line numbers, Of course if you have one window vertically.
Instead I used to this option.
JUST HOLDSHIFT KEY
DURING SELECTING TERMINAL TEXT TO BEHAVE LIKEset mouse-=a
In MacOSX with Iterm2, you would use ALT key instead of SHIFT.
On Mac with iterm2, I had to hold down OPTION key.
None of this was working for me without skip_defaults_vim
, which disables other things I wanted. But looking up defaults.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 use set mouse&
instead of set mouse-=a
now things work as described. VIM - Vi IMproved 9.0 (2022 Jun 28, compiled May 04 2023 10:24:44)
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
This way ends with text copied to clipboard with line numbers, Of course if you have one window vertically.
Instead I used to this option.
JUST HOLD
SHIFT KEY
DURING SELECTING TERMINAL TEXT TO BEHAVE LIKEset mouse-=a