Config Deep Dive
File System Layout
| Path | Purpose |
|---|---|
~/.tmux.conf | Symlink → canonical config (do not edit directly) |
~/github/common-config/tmux/tmux-config-symlink/.tmux.conf | Canonical config — edit this file |
~/.tmux/plugins/tpm/ | Plugin manager |
~/.tmux/plugins/tmux-resurrect/ | Session save/restore |
~/.tmux/plugins/tmux-continuum/ | Auto-save |
~/.local/share/tmux/resurrect/ | Session backup files (300+ snapshots) |
~/github/common-config/tmux/gc-sg-m16/continuum/<date>/ | Host-specific backup archive by date |
~/github/common-config/tmux/default config/ | tmux 3.4 defaults snapshot |
Config Chain
~/.tmux.conf → symlink to
~/github/common-config/tmux/tmux-config-symlink/.tmux.conf
Edit the canonical file, not the symlink. Reload with tmux source-file ~/.tmux.conf.
Backup Chain
tmux-resurrect saves to:
~/.local/share/tmux/resurrect/tmux_resurrect_<timestamp>.txt
tmux-continuum auto-saves every 15 minutes.
Post-save hook copies to:
~/github/common-config/tmux/gc-sg-m16/continuum/<date>/
(60-day retention, auto-cleanup)
Default vs This Server
Prefix
| Default | This Server | |
|---|---|---|
| Prefix key | Ctrl+b | Ctrl+Space |
| Send literal prefix | Ctrl+b Ctrl+b | Ctrl+Space Ctrl+Space |
Settings Changed
| Setting | Default | This Server |
|---|---|---|
default-command | '' | bash -c 'cd ~ && exec bash' |
set-clipboard | external | on |
extended-keys | off | on |
status-style | bg=green,fg=black | bg=colour17,fg=white |
status-left-length | 10 | 40 |
default-shell | /bin/bash | /bin/bash |
history-limit | 2000 | 2000 (default) |
Custom Bindings Added
Mnemonic Splits
| Default | Modification | Action |
|---|---|---|
Ctrl+b % | `Ctrl+Space | ` |
Ctrl+b " | Ctrl+Space - | Split vertically (horizontal dash → top/bottom) |
Prefix-Free Navigation
| Default | Modification | Action |
|---|---|---|
Ctrl+b arrows | Alt+arrows | Navigate panes (no prefix) |
Ctrl+b arrows | Alt+h/j/k/l | Navigate panes vim-style (no prefix) |
Ctrl+b z | Alt+z | Toggle zoom (no prefix) |
Ctrl+b n/p | Alt+PageDown/Up | Next/previous window (no prefix) |
Ctrl+b 1/2/3 | Alt+1/2/3 | Jump to window 1/2/3 (no prefix) |
Ctrl+b (/ ) | Alt+Home/End | Previous/next session (no prefix) |
Modal Tables
| Table | Key | Then | Action |
|---|---|---|---|
| Swap pane | Prefix S | Left/Right/Up/Down or h/j/k/l | Swap with pane in direction |
| Rename | Prefix e | w / s / p | Rename window / session / pane title |
Custom Quick Actions
| Default | Modification | Action |
|---|---|---|
Ctrl+b c | Ctrl+Space W | New window |
Ctrl+b & | Ctrl+Space X | Kill current window (prompted) |
| — | Ctrl+Space N | New named session |
| — | Ctrl+Space k | Kill current session (prompted) |
Ctrl+b s | Ctrl+Space s | Session chooser |
Ctrl+b w | Ctrl+Space w | Window/pane tree |
Ctrl+b L | Ctrl+Space L | Last session |
Ctrl+b m | Ctrl+Space a | Toggle mouse |
Defaults Removed
| Default | Reason |
|---|---|
Prefix O | Unbound |
Prefix A | Unbound (replaced by mouse toggle Prefix a) |
Prefix S | Unbound (replaced by swap table) |
Prefix H/J/K/L | Unbound |
Annotated ~/.tmux.conf
Local Overrides
set -g default-command "bash -c 'cd ~ && exec bash'"
set -g set-clipboard on
set -g extended-keys on
set-option -g status-style bg=colour17,fg=white
set -g status-left-length 40
Starts every new pane in the home directory. Enables clipboard and extended keys. Dark status bar matching the terminal theme.
Prefix Change
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
Changes the prefix from Ctrl+b to Ctrl+Space. The send-prefix binding lets you send Ctrl+Space to nested tmux sessions by pressing it twice.
Mnemonic Split Bindings
bind - split-window -v
bind '|' split-window -h
- looks like a horizontal line (top/bottom split). | looks like a vertical line (left/right split).
Prefix-Free Navigation
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
bind -n M-z resize-pane -Z
All Alt+ shortcuts work without the prefix key. Arrow keys and vim-style hjkl both work for pane navigation.
Window and Session Shortcuts
bind -n M-PageUp previous-window
bind -n M-PageDown next-window
bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-Home switch-client -p
bind -n M-End switch-client -n
Prefix-free window switching with Alt+PageUp/Down and session switching with Alt+Home/End.
Swap Pane Table
bind S switch-client -T opencode-swap
bind -T opencode-swap Left swap-pane -s '{left-of}'
bind -T opencode-swap Right swap-pane -s '{right-of}'
bind -T opencode-swap Up swap-pane -s '{up-of}'
bind -T opencode-swap Down swap-pane -s '{down-of}'
bind -T opencode-swap h swap-pane -s '{left-of}'
bind -T opencode-swap j swap-pane -s '{down-of}'
bind -T opencode-swap k swap-pane -s '{up-of}'
bind -T opencode-swap l swap-pane -s '{right-of}'
Press Prefix S (then release), then use arrows or hjkl to swap the current pane with the one in that direction.
Rename Table
bind e switch-client -T opencode-rename
bind -T opencode-rename w command-prompt -I "#W" { rename-window "%%" }
bind -T opencode-rename s command-prompt -I "#S" { rename-session "%%" }
bind -T opencode-rename p command-prompt -I "#{pane_title}" { select-pane -T "%%" }
Press Prefix e (then release), then w to rename window, s to rename session, or p to set pane title.
Quick Actions
bind a if-shell -F '#{mouse}' 'set -g mouse off' 'set -g mouse on'
bind N command-prompt -p "new session name" { new-session -s "%%" }
bind W new-window
bind L switch-client -l
bind X confirm-before -p "kill-window #W? (y/n)" kill-window
bind k confirm-before -p "kill-session #S? (y/n)" kill-session
Toggle mouse mode with Prefix a. Create new named sessions with Prefix N. Prefix X kills the current window with a safety prompt, Prefix k kills the current session with a safety prompt.
Copy Mode Additions
bind -T copy-mode S-Left send-keys -X begin-selection \; send-keys -X cursor-left
bind -T copy-mode S-Right send-keys -X begin-selection \; send-keys -X cursor-right
bind -T copy-mode C-S-Left send-keys -X begin-selection \; send-keys -X previous-word
bind -T copy-mode C-S-Right send-keys -X begin-selection \; send-keys -X next-word-end
bind -T copy-mode h send-keys -X begin-selection \; send-keys -X cursor-left
bind -T copy-mode j send-keys -X begin-selection \; send-keys -X cursor-down
bind -T copy-mode k send-keys -X begin-selection \; send-keys -X cursor-up
bind -T copy-mode l send-keys -X begin-selection \; send-keys -X cursor-right
bind -T copy-mode C-a send-keys -X history-top \; send-keys -X begin-selection \; send-keys -X history-bottom \; send-keys -X copy-pipe-and-cancel
Shift+arrow starts a character selection. Ctrl+Shift+arrow extends by word. hjkl in copy mode also selects while moving. Ctrl+a selects and copies all content (select all).
Plugin Block
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @continuum-restore 'on'
set -g @resurrect-dir "$HOME/.local/share/tmux/resurrect"
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes 'yazi opencode ssh btop visidata python3'
Three plugins active: TPM for management, resurrect for manual save/restore, continuum for auto-save.
Backup Hook
set -g @resurrect-hook-post-save-layout '
mkdir -p ~/github/common-config/tmux/gc-sg-m16/continuum/$(date +%F) &&
cp "$1" ~/github/common-config/tmux/gc-sg-m16/continuum/$(date +%F)/tmux-resurrect-$(hostname)-$(basename "$1") &&
find ~/github/common-config/tmux/gc-sg-m16/continuum/ -mindepth 2 -type f -mtime +60 -delete &&
find ~/github/common-config/tmux/gc-sg-m16/continuum/ -mindepth 1 -type d -empty -delete'
Every save triggers a copy to a dated directory under common-config for git tracking. Backups older than 60 days are cleaned up automatically.
Final Bindings
run '~/.tmux/plugins/tpm/tpm'
bind w choose-tree -Zw
TPM must be the last line. Prefix w opens the searchable session/window/pane tree.