Permalink
Browse files

tmux: set copy binding depending on version

  • Loading branch information...
1 parent 4229abd commit df4c7e811b2f204beab97e98cb93d1e2e145cb4c @majutsushi committed Jun 21, 2017
Showing with 5 additions and 1 deletion.
  1. +5 −1 tmux/tmux.conf
View
@@ -1,3 +1,5 @@
+run-shell "tmux setenv -g TMUX_VERSION $(tmux -V | awk '{ print $2 }')"
+
# Server options
set-option -sg buffer-limit 100
set-option -sg escape-time 50
@@ -107,7 +109,9 @@ bind-key -r C-l resize-pane -R 1
# Change layout to 3x2 panes
bind-key M-6 select-layout 'b2b1,319x82,0,0{105x82,0,0[105x41,0,0,129,105x40,0,42,150],105x82,106,0[105x41,106,0,134,105x40,106,42,151],107x82,212,0[107x41,212,0,136,107x40,212,42,152]}'
-bind-key -t vi-copy Enter copy-pipe "xclip -i -selection clipboard"
+if-shell 'expr $TMUX_VERSION \< 2.4' \
+ "bind-key -t vi-copy Enter copy-pipe 'xclip -i -selection clipboard'" \
+ "bind-key -T copy-mode-vi Enter send-keys -X copy-pipe 'xclip -i -selection clipboard'"
# bind-key -t vi-copy Escape cancel # clashes with tmux-copycat
# Use save-buffer instead of show-buffer to avoid inserting spurious linebreaks
bind-key C-y run-shell -b "tmux save-buffer - | xclip -i -selection clipboard"

0 comments on commit df4c7e8

Please sign in to comment.