mirror of
https://github.com/tmux-plugins/tmux-yank.git
synced 2026-09-10 07:36:17 -04:00
| scripts | ||
| video | ||
| CHANGELOG.md | ||
| LICENSE.md | ||
| README.md | ||
| yank.tmux | ||
Tmux Yank
Enables copying to system clipboard in Tmux. Works on Linux and OS X.
Screencast
Key bindings
prefix + y- copies text from the command line to clipboard.
Works with all popular shells/repls. Tested with:- shells:
bash,zsh(withbindkey -e),tcsh - repls:
irb,pry,node,psql,python,php -a,coffee - remote shells:
ssh, mosh
- shells:
copy mode bindings:
y- copy selection to system clipboardCtrl-y- "put" selection - equivalent to copying a selection, and pasting it to the command lineAlt-y- performs both of the above: copy to system clipboard and put to command line
OS X requirements
- reattach-to-user-namespace
If you don't have this already, then install:$ brew install reattach-to-user-namespace.
Linux requirements
xclipcommand
You most likely already havexclip, but if not:- 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 " \
tmux-plugins/tpm \
tmux-plugins/tmux-yank \
"
Hit prefix + I to fetch the plugin and source it. You should now be able to
use the plugin.
Manual Installation
Clone the repo:
$ git clone https://github.com/tmux-plugins/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.
Other Tmux goodies
Tmux yank works well with tmux copycat.
