Yanks to system clipboard.
Go to file
Bruno Sutic 260c29505b v0.0.2
2014-06-25 16:02:58 +02:00
scripts Line copy feature now works accross multiple lines 2014-06-25 15:35:48 +02:00
CHANGELOG.md v0.0.2 2014-06-25 16:02:58 +02:00
LICENSE.md First commit 2014-06-24 11:39:47 +02:00
README.md Add copy to command line feature to readme 2014-06-25 16:02:14 +02:00
yank.tmux Extract key-related functions to a helper 2014-06-25 13:33:23 +02:00

Tmux Yank

Enables copying to system clipboard in Tmux. Works on Linux and OS X.

Key bindings:

  • prefix + y - copies text from the command line to clipboard. It does not mess up the command you're writing.
    This feature works for any shell or repl where readline is enabled. To test this check if Ctrl-a binding takes you to the start of the line. This should work for all popular shells/repls, but please try out it for your specific scenario.
    Tested and working for: bash, zsh (with bindkey -e), tcsh, irb, pry, node, psql, python, php -a, coffee

copy mode bindings:

  • y - copy selection to system clipboard
  • Ctrl-y - "put" selection - equivalent to copying a selection, and pasting it to the command line
  • Alt-y - performs both of the above: copy to system clipboard and put to command line

OS X requirements

Linux requirements

  • xclip command
    You most likely already have xclip, but if not install:
    • Debian / Ubuntu: $ sudo apt-get install xclip
    • Red hat / CentOS: $ yum install xclip

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.

Manual Installation

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.

Other Tmux goodies

Tmux yank works well with tmux copycat.

License

MIT