Upgraded here a few VM servers to Debian 9.
Now when using ssh
, we cannot copy and paste between remote terminals.
The cursor seems to be doing the movements, and marking the text, albeit in a funnier/different way than the usual, but nothing gets copied other to the clipboard when doing command-C / command-V or copy and paste in the respective menu.
We also tried doing the mouse movements with Shift and other keyboard combinations, without positive results.
This is happening in OS/X, namely Sierra and El Capitan, and in Windows, using mobaXterm terminals too.
The situation is due to vim´s awareness of having a mouse.
Following other questions in Stack Overflow, I created /etc/vim/vimrc.local
with set mouse="r"
and set mouse="v
; it did not work out well.
Finally setup up set mouse=""
in the same file, with some moderate success.
However, it also does not work well 100% of the time. What else can be done?
Best Answer
Solution: change
mouse=a
tomouse=r
in your local.vimrc
.The problem with setting this in
/usr/share/vim/vim80/defaults.vim
as the accepted answer says, is that it will be overwritten on every update. I searched for a long time and ended up on this one: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=864074LOCAL SOLUTION (flawed):
The first solution is to use local .vimrc files and set it there. So you could create a local .vimrc (
~/.vimrc
) for every user and set your options there. Or create one in/etc/skel
so it will be automatically created for every new user you create.But when you use local
.vimrc
files, you have to set all options there, because if there is a local.vimrc
, thedefaults.vim
doesn't get loaded at all! And if there is no local.vimrc
all your settings are being overwritten fromdefaults.vim
.GLOBAL SOLUTION (preferrable):
I wanted a global configuration for all users, which loads the default options and then adds or overwrites the defaults with my personal settings. Luckily there is an option for that in Debian: The
/etc/vim/vimrc.local
will be loaded after the/etc/vim/vimrc
. So you can create this file and load defaults, preventing them from being loaded again (at the end) and then add your personal options:Please create the following file:
/etc/vim/vimrc.local
(Note that
$VIMRUNTIME
used in the above snippet has a value like/usr/share/vim/vim80/defaults.vim
.)If you also want to enable the "old copy/paste behavior", add the following lines at the end of that file as well: