From 633601dd5758c802d8874773b41ea42e51d56451 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Fri, 29 Aug 2014 04:30:09 -0400 Subject: [PATCH] ctrl-v to paste the X buffer and ctrl-y to send the tmux buffer to X --- README.md | 1 + tmux.normal.conf | 4 ++++ tmux.powerline.conf | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index aef9224..007c3ef 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ * `Escape`: Clear the terminal history, tmux history and the current window/pane. * `?` and `/`: Show help for available key bindings and commands respectively. * `y` and `Ctrl-p`: Enter __copy mode__ and paste from the copy buffer respectively. +* `Ctrl-v` and `Ctrl-y`: Pastes the X buffer in tmux, and sends the tmux buffer to X respectively. * (**copy mode**) `v`, `y` and `Escape`: Begin selection, copy selection and cancel **copy mode** respectively. * `Alt-[0-9]` (no prefix): Switch directly to the given window. * `W`: Write scrollback buffer to file. diff --git a/tmux.normal.conf b/tmux.normal.conf index e0e677a..f86c61c 100644 --- a/tmux.normal.conf +++ b/tmux.normal.conf @@ -111,6 +111,10 @@ bind / list-commands bind y copy-mode bind C-p paste-buffer # +# C-v and C-y to paste the X buffer, or copy the tmux buffer into X +bind C-v run "xclip -o | tmux load-buffer - ; tmux paste-buffer" +bind C-y run "tmux show-buffer | xclip -sel clip" +# # (copy mode) v,y and escape to select, copy and cancel respectively bind -t vi-copy y copy-selection bind -t vi-copy v begin-selection diff --git a/tmux.powerline.conf b/tmux.powerline.conf index 7fd3511..5ee73e2 100644 --- a/tmux.powerline.conf +++ b/tmux.powerline.conf @@ -111,6 +111,10 @@ bind / list-commands bind y copy-mode bind C-p paste-buffer # +# C-v and C-y to paste the X buffer, or copy the tmux buffer into X +bind C-v run "xclip -o | tmux load-buffer - ; tmux paste-buffer" +bind C-y run "tmux show-buffer | xclip -sel clip" +# # (copy mode) v,y and escape to select, copy and cancel respectively bind -t vi-copy y copy-selection bind -t vi-copy v begin-selection