diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf index 7fa20bd..c8b3447 100644 --- a/.config/tmux/tmux.conf +++ b/.config/tmux/tmux.conf @@ -134,17 +134,30 @@ set -g status-style bg=default,fg=white set -g message-command-style bg=default,fg=brightyellow set -g message-style bg=brightyellow,fg=black set -g mode-style bg=brightyellow,fg=black -set -g pane-border-style bg=default,fg=brightblack -set -g pane-active-border-style bg=default,fg=brightyellow + +# NOTE: `<` does string comparison with `strcmp()`. This means that the +# condition will break from a double digit major version (e.g. `10.0`) on. +if -F "#{<:#{version},3.2}" { + # Use pure style default for tmux < 3.2 in combination with the + # prefix_highlight plugin. + set -g pane-border-style bg=default,fg=brightblack + set -g pane-active-border-style bg=default,fg=brightyellow + + set -g @prefix_highlight_show_copy_mode 'on' + set -g @prefix_highlight_show_sync_mode 'on' + set -g @prefix_highlight_copy_mode_attr 'fg=black,bg=brightyellow' + set -g @prefix_highlight_sync_mode_attr 'fg=black,bg=brightred' +} { + # From 3.2 on, we can use formats in styles, so that all indicators can be + # done by the borders. + set -g pane-border-style "#{?synchronize-panes,fg=brightred,fg=brightblack}" + set -g pane-active-border-style "#{?pane_in_mode,bg=brightyellow#,fg=brightblack,#{?synchronize-panes,fg=brightred,fg=brightyellow}}" +} # Display in the status bar when the prefix was pressed, copy-mode is active, or # `synchronize-panes` is turned on set -g @prefix_highlight_fg 'brightyellow' set -g @prefix_highlight_bg 'default' -set -g @prefix_highlight_show_copy_mode 'on' -set -g @prefix_highlight_show_sync_mode 'on' -set -g @prefix_highlight_copy_mode_attr 'fg=black,bg=brightyellow' -set -g @prefix_highlight_sync_mode_attr 'fg=black,bg=brightred' set -g status-right "#{prefix_highlight}" set -g status-left "#{prefix_highlight}"