# Ctrl-b f: prompt for text, list windows whose name, pane title or pane contents match; Enter jumps # Ctrl-b w: tree of every window in every session; press f inside it to filter by name, Enter jumps # Ctrl-b s: tree of sessions (same tree, session view) # Ctrl-b p: go to the previous window (lower index, wraps); Ctrl-b n goes to the next one # # Vi mode for copy setw -g mode-keys vi # Mouse selection set -g mouse on # Persistent pane index labels (top-left of each pane's border) set -g pane-border-status top set -g pane-border-format "#P" # Explicitly swap current pane with a pane index you type in bind-key P command-prompt -p "swap with pane #:" "swap-pane -d -t '%%'" # Manual: :swap-pane -s -t # Vim-style pane resizing (prefix + H/J/K/L), magnitude 1 bind -r H resize-pane -L 1 bind -r J resize-pane -D 1 bind -r K resize-pane -U 1 bind -r L resize-pane -R 1 # ===== Shared clipboard: RAM file /dev/shm/clip/buf on CLIP_HOST ===== %hidden CLIP_HOST="root@p.noml.ch" # One persistent ssh link (opens on first use, one key touch). # Close it: ssh -O exit -o ControlPath=~/.ssh/cm-%C %hidden CLIP="ssh -o ControlMaster=auto -o ControlPersist=yes -o ControlPath=~/.ssh/cm-%C -o ServerAliveInterval=30 -o ConnectTimeout=3 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR $CLIP_HOST" # push (yank): copy mode v to select, then y / Enter / mouse drag %hidden YANK="$CLIP 'umask 077; mkdir -p /dev/shm/clip && cat >/dev/shm/clip/new && mv /dev/shm/clip/new /dev/shm/clip/buf'" bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T copy-mode-vi y send-keys -X copy-pipe-no-clear "$YANK" bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "$YANK" bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear "$YANK" # pull (paste): prefix + ] fetches the buffer into tmux, then pastes it; # no buffer on CLIP_HOST yet (exit 3, e.g. after its reboot) = paste tmux's own buffer bind-key ] run-shell "f=\$(mktemp); $CLIP '[ -f /dev/shm/clip/buf ] || exit 3; cat /dev/shm/clip/buf' >\$f; r=\$?; [ \$r -eq 0 ] && tmux load-buffer \$f; rm -f \$f; [ \$r -eq 0 ] || [ \$r -eq 3 ] && tmux paste-buffer" # ===== end shared clipboard ===== # Linux only: true-color regardless of what TERM the outer terminal/distro sets if-shell 'uname | grep -q Darwin' {} { set -g default-terminal "tmux-256color" set -ga terminal-overrides ",*256col*:Tc" }