From 20eb4e54d89d8c5a88f48bc336f989a2d07f04f8 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Thu, 26 Dec 2019 13:59:23 -0800 Subject: [PATCH] Added clipboard integration --- user.tmux.conf | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/user.tmux.conf b/user.tmux.conf index d74a40d..4d801f5 100644 --- a/user.tmux.conf +++ b/user.tmux.conf @@ -2,7 +2,7 @@ # TMUX Configuration file # # General settings {{{ - set -g default-terminal "screen-256color" + set -g default-terminal "xterm-256color" set -g prefix C-a unbind-key C-b bind-key C-a send-prefix @@ -10,7 +10,6 @@ set -as terminal-overrides ",*:U8=0" set -g mouse on - bind r source-file ~/.tmux.conf set -g status-position top # set -g status-windows-justify middle @@ -41,6 +40,17 @@ bind -n M-j select-pane -D bind -n M-k select-pane -U bind -n M-l select-pane -R + + # Clipboard integration + # ctrl+c to send to clipboard + + # Selection with mouse should copy to clipboard right away, in addition to the default action. + unbind -n -Tcopy-mode-vi MouseDragEnd1Pane + bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel\; run "tmux save-buffer - | xclip -i -sel clipboard > /dev/null" + + # Middle click to paste from the clipboard + unbind-key MouseDown2Pane + bind-key -n MouseDown2Pane run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" # }}} # Footer {{{