I use tmux to copy text while in copy-mode often, but what I'd like to do is copy text using command line instead of entering copy-mode.
For example, when I'm in vim directly on my mac computer, I like to select a line with V
, then pipe that to the system clipboard with by pressing :
, which then gives the '<,'>
, meaning, take the currently highlighted vim text, and then w ! pbcopy
. Pipe the highlighted vim text to system clipboard. This is useful when the line is too long to render so that tmux's copy-mode can "see" it, and I don't want to set wrap
in vim.
I'd like to do the same for tmux, like, if this were a thing:
$ echo "some text" | tmux copy-buffer
Or, after highlighting a line with V
in vim:
:'<,'>w ! tmux copy-buffer
Alas, I couldn't find anything in man tmux
that suggested I could do this. Anyone know how?