I am a little embarrassed to ask this question, but this topic seems to be particularly difficult to search.
On Linux systems I almost exclusively use the terminal and access the systems (from macOS most often) using SSH through a terminal emulator.
In the general sense, copying and pasting code snippets and errors from logs, etc. is a tricky problem to traverse the buffer across systems, when a terminal multiplexer is involved, and this is usually achieved by copying via the terminal emulator's own selection feature and use the client's OS's paste buffer. This question is NOT ABOUT THAT.
My issue is when I have a large number of vim instances open on a single Linux server. I am in runlevel 3 and do not run a GUI. There is no xclip available to me, mainly because X is not installed.
When I am in this workflow I find the need to yank parts of files and paste them in other vims on the same remove box. Vim's builtin +
and *
copy/paste buffers do not work. (the clipboard compile option in vim is not enabled on these systems)
However, what works is if I yank some text in one vim instance, quit it, and open another vim instance, then pasting works. So something about exiting vim persists the buffer somewhere. I think that if I can just have whatever this system is work in realtime without having to close vims, that would be great. I would like to avoid having to layer a bind on yanks and deletes to implement my own yank/paste implementation.
tmux
/screen
and their internal clipboard: unix.stackexchange.com/a/58765/70524. Runningtmux
orscreen
will be handy if you spend a lot of time on SSH.