From ce80b815161b6fafff8fc96033c52d36085ad726 Mon Sep 17 00:00:00 2001 From: Sonny Date: Thu, 14 Jun 2018 22:42:54 +0200 Subject: [PATCH] Remove unneeded if loops --- tmux/.tmux.conf | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index c8ebb29..0150847 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -1,22 +1,11 @@ # use vim copy/paste keybindings setw -g mode-keys vi -# needs xclip for system clipboard -run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | cut -c 6-)" -if-shell -b '[ "$(echo "$TMUX_VERSION < 2.4" | bc)" = 1 ]' \ - "bind-key Escape copy-mode; \ - bind-key -t vi-copy Escape cancel; \ - bind-key p paste-buffer; \ - bind-key -t vi-copy v begin-selection; \ - bind-key -t vi-copy V select-line; \ - bind-key -t vi-copy r rectangle-toggle; \ - bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'" +# Copy vim-style to clipboard +bind -t vi-copy y copy-pipe "xclip -sel clip -i" -if-shell -b '[ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \ - "bind-key -T copy-mode-vi 'v' send -X begin-selection; \ - bind-key -T copy-mode-vi 'V' send -X select-line; \ - bind-key -T copy-mode-vi 'r' send -X rectangle-toggle; \ - bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel 'xclip -in -selection clipboard'" +# Paste clipboard into window +bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" # split panes using | and - bind | split-window -h @@ -54,6 +43,3 @@ setw -g window-status-format ' #I#[fg=colour0] #[fg=colour0]#W ' set -g history-limit 10000 set -g mouse on - -# terminal colors -