I have been using vi or vim for many years however recently ( past year or two ) when I paste some highlighted text vim seems to paste highlighted text ( more often than not ) to random location in the file ... I paste by hitting mouse middle roller button and I think vim is poorly handling the paste by sensing a minute amount of roller action during the press down in the mouse middle roller button during the paste action
Here is my cat ~/.vimrc
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
set ts=4
set ic
syntax on
" to shut off paste indent
se paste
" to disable paste moving mouse paste location
" mouse=r
" above fails: E492: Not an editor command: mouse=r
" mouse=v
" above ALSO fails: E492: Not an editor command: mouse=r
" If this does not work, a common problem is not having ownership of your ~/.viminfo file. If this is the case, then sudo chown user:group ~/.viminfo
" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
Notice commented above two attempts to fix this
Please note this never happened before a year or two ago ... since then its almost useless to even use vim due to this reason ... Is there a way to tell vim to always ignore any roller actions from mouse middle roller button ( continue to sense the press of that roller yet ignore the roller )
I do not use any vim plugins
I am on Ubuntu 20.04 yet same vim bug happens on any Ubuntu for past many years
vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Feb 01 2022 09:16:32)
Included patches: 1-2269, 3612, 3625, 3669, 3741
In the mean time I am trying to always use shift + insert
to paste instead of using the much more convenient mouse middle roller button press
:set mouse=r
se paste
is a VERY bad idea.