Enables copying to system clipboard in Tmux. Works on Linux and OS X.
Copy mode mappings:
y- copy selection to system clipboardC-y- "put" selection to the command lineM-y(Alt + y) - performs both of the above: copy to system clipboard and put to command line
- reattach-to-user-namespace
If you already don't have this installed, then:$ brew install reattach-to-user-namespace.
xclipcommand
You most likely already havexclip, but if not install with:- Debian / Ubuntu:
$ sudo apt-get install xclip - Red hat / CentOS:
$ yum install xclip
- Debian / Ubuntu:
Installation with Tmux Plugin Manager (recommended)
Add plugin to the list of TPM plugins in .tmux.conf:
set -g @tpm_plugins " \
bruno-/tpm \
bruno-/tmux_yank \
"
Hit prefix + I to fetch the plugin and source it. You should now be able to
use the plugin.
Clone the repo:
$ git clone https://github.com/bruno-/tmux_yank ~/clone/path
Add this line to the bottom of .tmux.conf:
run-shell ~/clone/path/yank.tmux
Reload TMUX environment:
# type this in terminal
$ tmux source-file ~/.tmux.conf
You should now be able to use the plugin.
Tmux yank works well with tmux copycat.