commit 7ec402f5893d54c58246ee63d8b50027cd6c260c
parent c0563fff769b9195d72f3057f871c02b7a51778b
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 15 Jan 2020 09:07:38 +0100
Add yank and paste bindings for both clipboards
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.tmux.conf b/.tmux.conf
@@ -104,12 +104,14 @@ bind Space copy-mode # enter copy mode with <C-a><Space>
bind -T copy-mode-vi v send -X begin-selection # start "visual" with v
# Copy (yank) with y
-bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "DISPLAY=:0 xclip -i -selection clipboard"
+bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "DISPLAY=:0 xclip -i"
+bind -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "DISPLAY=:0 xclip -i -selection clipboard"
if-shell 'uname | grep -qi Darwin' 'bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "pbcopy"'
if-shell 'uname | grep -qi Cygwin' 'bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "cat > /dev/clipboard"'
# Paste with C-a p or M-p
-bind p run "DISPLAY=:0 xclip -selection clipboard -o | tmux load-buffer - ; tmux paste-buffer"
+bind p run "DISPLAY=:0 xclip -o | tmux load-buffer - ; tmux paste-buffer"
+bind P run "DISPLAY=:0 xclip -selection clipboard -o | tmux load-buffer - ; tmux paste-buffer"
if-shell 'uname | grep -qi Darwin && which reattach-to-user-namespace > /dev/null' 'bind p run "pbpaste | tmux load-buffer - ; tmux paste-buffer"'
if-shell 'uname | grep -qi Cygwin' 'bind p run "cat /dev/clipboard | tmux load-buffer - ; tmux paste-buffer"'