From 619da42387298cbdca6cf934e76819b3792704a9 Mon Sep 17 00:00:00 2001 From: David Thurstenson Date: Thu, 27 Apr 2017 09:55:37 -0500 Subject: [PATCH] Fixed copy mode bindings, using shiny new conditional block to avoid recreating layout when reloading config --- .tmux.conf | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 221a868..849f5ed 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,7 +1,9 @@ set -g default-terminal "tmux-256color" -# Set up default session -new +# Set up default session, attach to an existing one if available +new -As0 + +%if #{==:#{window_panes},1} # Split window splitw -v -p 60 splitw -h -p 50 @@ -10,8 +12,7 @@ send -t 0:0.0 'weechat' Enter send -t 0:0.2 'vifm' Enter # Set focus on pane 1 selectp -t 0:0.1 - - +%endif set-option -g assume-paste-time 1 set-option -g base-index 1 @@ -92,10 +93,10 @@ bind -n M-j select-pane -D set -sg escape-time 0 # Various copy mode tweaks -bind-key -T copy-mode-vi Home start-of-line -bind-key -T copy-mode-vi End end-of-line +bind-key -T copy-mode-vi Home send -X start-of-line +bind-key -T copy-mode-vi End send -X end-of-line # Sync copy mode and PRIMARY selection -bind-key -T copy-mode-vi MouseDragEnd1Pane copy-pipe "xsel -i -p -b" -bind-key -T copy-mode-vi Enter copy-pipe "xsel -i -p -b" -bind-key -T copy-mode-vi y copy-pipe "xsel -i -p -b" +bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe "xsel -i -p -b" +bind-key -T copy-mode-vi Enter send -X copy-pipe "xsel -i -p -b" +bind-key -T copy-mode-vi y send -X copy-pipe "xsel -i -p -b"