When I do a middle mouse click to paste a vim command into the xterm, instead of just performing the requested actions, vim first enters edit mode and THEN processes the text to paste (resulting in it being inserted as text instead of being interpreted as commands). I don't have "set mouse=$something", cas on unix.stackexchange.com suggested to add "set mouse=" to my ~/.vimrc, which I did without success, afterwards, he suggested, this to be very likely a Gentoo bug.
Normal mouse interaction works as expected in the same xterm without vim like in bash (i.e. middle mouse click just inserts mouse buffer).
Except from the problem I described here, vim seems to ignore the mouse thus it behaves normally, allowing me so select text into the mouse buffer and pasting it back somewhere else.
For furter reference, my unix.SE.com question: https://unix.stackexchange.com/questions/379398/using-middle-mouse-click-to-paste-text-enters-insert-mode
I can reproduce this, but did not know that it could be a "bug". However, the vim team will know better about this.
A quick Google search would have led you to this page https://github.com/vim/vim/issues/1388
A Vim maintainer explains that the clipboard support is turned off when Vim is compiled with the --with-features=tiny flag. We support that flag through the minimal USE flag: Vim minimal supports a tiny set of features whilst normal Vim support a much larger set.
Please give it a try and report back. Thanks!
I tested vim's behavior after reemerging it with minimal, the reported issue remains unchanged.
This are the flags i have set on vim (now, after removing minimal again):
[ebuild R ] app-editors/vim-8.0.0386::gentoo USE="X acl nls perl python ruby tcl -cscope -debug -gpm -lua -luajit -minimal* -racket (-selinux) -vim-pager" PYTHON_TARGETS="python2_7 python3_4 (-python3_5) (-python3_6)" 0 KiB
After noticing the X USE flag, I just tried reemerging vim with various combination of use flags:
2. -acl -nls -perl
3. -python -ruby -tcl
4. -X -acl -nls -perl -python -ruby -tcl
(this means: No use flag set at all)
5. -X -acl -nls -perl -python -ruby -tcl debug gpm lua vim-pager
(all use flags set except for cscope luajit and racket, because those would install new dependencies and selinux)
In all those combinations, the issue remains.