Skip to content

Commit 4e6c638

Browse files
committed
get copy-pasting working with tmux v2.4
1 parent 53b3786 commit 4e6c638

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.tmux.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ bind-key a send-prefix
6262
setw -g monitor-activity on
6363
set -g visual-activity on
6464

65-
# Vi copypaste mode
66-
set-window-option -g mode-keys vi
67-
bind-key -t vi-copy 'v' begin-selection
68-
bind-key -t vi-copy 'y' copy-selection
69-
7065
# hjkl pane traversal
7166
bind h select-pane -L
7267
bind j select-pane -D
@@ -94,6 +89,11 @@ set -g default-terminal "screen-256color"
9489
run-shell "tmux set-environment -g TMUX_VERSION_MAJOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f1 | sed 's/[^0-9]*//g')"
9590
run-shell "tmux set-environment -g TMUX_VERSION_MINOR $(tmux -V | cut -d' ' -f2 | cut -d'.' -f2 | sed 's/[^0-9]*//g')"
9691

92+
# Vi copypaste mode
93+
set-window-option -g mode-keys vi
94+
if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 4 \)'" 'bind-key -Tcopy-mode-vi v send -X begin-selection; bind-key -Tcopy-mode-vi y send -X copy-selection-and-cancel'
95+
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 4\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'bind-key -t vi-copy v begin-selection; bind-key -t vi-copy y copy-selection'
96+
9797
# status bar
9898
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 2\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'set-option -g status-utf8 on'
9999

0 commit comments

Comments
 (0)