-
Make sure you have a clipboard-aware Vim build. I recommend MacVim.
-
Install or update XQuartz.app and start it.
-
In the Preferences window, activate clipboard synchronization.
-
Quit XQuartz.app.
-
In iTerm.app or Terminal.app, connect to your remote machine with:
$ ssh -X username@host
and see the XQuartz.app icon pop-up in your Dock.
From now on, XQuartz.app will start automatically in the background when you use the -X
flag, taking care of the clipboard synchronization for you.
-
If you don't already have it, install GVim. On Debian-based systems, use:
$ sudo apt-get install vim-gtk
The idea is not to use Gvim but installing it gets you everything you need to get clipboard sharing to work:
- a minimal X
- a Vim built with clipboard support
-
In Vim, synchronize the unnamed and clipboard registers by adding this line to
~/.vimrc
:set clipboard^=unnamed
This did not work for me. Here were my steps:
I've tried restarting everything, but it just doesn't work. Any suggestions?
System: OSX Catalina
vim --version:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 18 2020 18:29:15)
Included patches: 1-1453
Modified by [email protected]
Compiled by [email protected]
Huge version with GTK3 GUI. Features included (+) or not (-):