On my Linux computers I have used
xclip for having clipboard support for some years but never got it to run in my servers because they do not have X server and you need one for the clipboard, always got a:
xclip: Error: Can't open display: (null)
So I had to do a workaround and the easiest thing to do was using a temporary file:
Basically: if there's no
$DISPLAY set then send the copied selection to the file
/tmp/theClipboardWithoutX with the keybinds Ctrl+C and with Ctrl+V you get the data inside that file. If there's
$DISPLAY then use
Surprisely it works very well.
Check my full
vimrc for copy and paste stuff (has configs for Mac as well) and if you want, the full vimfiles repo may come handy as well.