@@ -55,32 +55,41 @@ bind-key T previous-window
55
55
bind-key [ copy-mode
56
56
bind-key ] paste-buffer
57
57
58
- # Setup 'v' to begin selection as in Vim
59
- bind-key -t vi-copy v begin-selection
60
- bind-key -t vi-copy y copy-pipe " reattach-to-user-namespace pbcopy"
58
+ run-shell " tmux setenv -g TMUX_VERSION $( tmux -V | cut -c 6-) "
61
59
60
+ # Setup 'v' to begin selection as in Vim
62
61
# Update default binding of `Enter` to also use copy-pipe
63
- unbind -t vi-copy Enter
64
- bind-key -t vi-copy Enter copy-pipe " reattach-to-user-namespace pbcopy"
62
+ #
63
+ # New keybindings for vi-mode when version >= 2.4
64
+ # https://github.com/tmux/tmux/issues/754
65
+ if-shell -b ' [ "$(echo "$TMUX_VERSION >= 2.4" | bc)" = 1 ]' \
66
+ ' bind-key -T copy-mode-vi v send-keys -X begin-selection ; \
67
+ bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" ; \
68
+ unbind -T copy-mode-vi Enter ; \
69
+ bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"; ' \
70
+ ' bind-key -t vi-copy v begin-selection ; \
71
+ bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" ; \
72
+ unbind -t vi-copy Enter ; \
73
+ bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"; '
65
74
66
75
set-window-option -g display-panes-time 1500
67
76
68
77
# Status Bar
69
78
set-option -g status-interval 1
70
79
set-option -g status-left ' '
71
80
set-option -g status-right ' %l:%M%p'
72
- set-window-option -g window-status-current-fg magenta
73
- set-option -g status-fg default
81
+ set-window-option -g window-status-current-style fg= magenta
82
+ set-option -g status-style fg= default
74
83
75
84
# Status Bar solarized-dark (default)
76
- set-option -g status-bg black
77
- set-option -g pane-active-border-fg black
78
- set-option -g pane-border-fg black
85
+ set-option -g status-style bg= black
86
+ set-option -g pane-active-border-style fg= black
87
+ set-option -g pane-border-style fg= black
79
88
80
89
# Status Bar solarized-light
81
- if-shell " [ \" $COLORFGBG \" = \" 11;15\" ]" " set-option -g status-bg white"
82
- if-shell " [ \" $COLORFGBG \" = \" 11;15\" ]" " set-option -g pane-active-border-fg white"
83
- if-shell " [ \" $COLORFGBG \" = \" 11;15\" ]" " set-option -g pane-border-fg white"
90
+ if-shell " [ \" $COLORFGBG \" = \" 11;15\" ]" " set-option -g status-style bg= white"
91
+ if-shell " [ \" $COLORFGBG \" = \" 11;15\" ]" " set-option -g pane-active-border-style fg= white"
92
+ if-shell " [ \" $COLORFGBG \" = \" 11;15\" ]" " set-option -g pane-border-style fg= white"
84
93
85
94
# Set window notifications
86
95
setw -g monitor-activity on
0 commit comments