Fixed copy mode bindings, using shiny new conditional block to avoid recreating layout when reloading config

This commit is contained in:
David Thurstenson 2017-04-27 09:55:37 -05:00
parent e25c161ade
commit 619da42387
1 changed files with 10 additions and 9 deletions

View File

@ -1,7 +1,9 @@
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
# Set up default session # Set up default session, attach to an existing one if available
new new -As0
%if #{==:#{window_panes},1}
# Split window # Split window
splitw -v -p 60 splitw -v -p 60
splitw -h -p 50 splitw -h -p 50
@ -10,8 +12,7 @@ send -t 0:0.0 'weechat' Enter
send -t 0:0.2 'vifm' Enter send -t 0:0.2 'vifm' Enter
# Set focus on pane 1 # Set focus on pane 1
selectp -t 0:0.1 selectp -t 0:0.1
%endif
set-option -g assume-paste-time 1 set-option -g assume-paste-time 1
set-option -g base-index 1 set-option -g base-index 1
@ -92,10 +93,10 @@ bind -n M-j select-pane -D
set -sg escape-time 0 set -sg escape-time 0
# Various copy mode tweaks # Various copy mode tweaks
bind-key -T copy-mode-vi Home start-of-line bind-key -T copy-mode-vi Home send -X start-of-line
bind-key -T copy-mode-vi End end-of-line bind-key -T copy-mode-vi End send -X end-of-line
# Sync copy mode and PRIMARY selection # 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 MouseDragEnd1Pane send -X 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 Enter send -X 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 y send -X copy-pipe "xsel -i -p -b"