Skip to content

Instantly share code, notes, and snippets.

@mjf
Last active October 12, 2023 13:11
Show Gist options
  • Save mjf/dcfdd6f1c8eadcd0623f2434a0c2192a to your computer and use it in GitHub Desktop.
Save mjf/dcfdd6f1c8eadcd0623f2434a0c2192a to your computer and use it in GitHub Desktop.
tmux(1) synchronize panes toggling
set -g status-style 'bg=green fg=black'
set -g status-position top
set -g message-style 'bg=yellow fg=black'
set -g pane-border-status bottom
set -g pane-border-style 'bg=black fg=white dim'
set -g pane-active-border-style 'bg=black fg=cyan'
set -g pane-border-format "#{?pane_active,#[reverse],#[default]} #{pane_title} (#{pane_index}) "
bind z run-shell '\
tmux show-options -w |grep -q "^synchronize-panes on$" && { \
tmux set-option -w synchronize-panes off; \
tmux set -g status-style "bg=green fg=black"; \
tmux set -g pane-active-border-style "fg=cyan"; \
} || { \
tmux set-option -w synchronize-panes on; \
tmux set -g status-style "bg=red fg=black"; \
tmux set -g pane-active-border-style "fg=red"; \
}'
# vi:ft=sh:nowrap:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment