Shell
# ============================================
# TMUX Configuration - IDE Mode
# ============================================
# --------------------------------------------
# Better Prefix Key (Ctrl+a instead of Ctrl+b)
# --------------------------------------------
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# --------------------------------------------
# Mouse Support (scroll, click to select pane, resize)
# --------------------------------------------
set -g mouse on
# --------------------------------------------
# Easy Pane Navigation (Alt + Arrow, no prefix needed)
# --------------------------------------------
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
# Vim-style pane navigation (prefix + hjkl)
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# --------------------------------------------
# Easy Pane Resizing (prefix + HJKL)
# --------------------------------------------
bind -r H resize-pane -L 5
bind -r J resize-pane -D 5
bind -r K resize-pane -U 5
bind -r L resize-pane -R 5
# --------------------------------------------
# Easy Splits (more intuitive keys)
# --------------------------------------------
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %
# --------------------------------------------
# Quick Reload Config
# --------------------------------------------
bind r source-file ~/.tmux.conf \; display "Config reloaded!"
# --------------------------------------------
# Start numbering at 1 (easier to reach)
# --------------------------------------------
set -g base-index 1
setw -g pane-base-index 1
# --------------------------------------------
# Renumber windows when one is closed
# --------------------------------------------
set -g renumber-windows on
# --------------------------------------------
# Auto-rename windows (configured below with titles)
# --------------------------------------------
set -g allow-rename on
# --------------------------------------------
# Faster escape time (for vim users)
# --------------------------------------------
set -sg escape-time 0
# --------------------------------------------
# Increase history
# --------------------------------------------
set -g history-limit 50000
# --------------------------------------------
# True color support
# --------------------------------------------
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color:Tc"
# ============================================
# THEME - Amber Ember
# ============================================
# Color palette:
# Dark amber bg: colour52 (#5f0000) or colour94 (#875f00)
# Amber: colour208 (#ff8700)
# Orange: colour202 (#ff5f00)
# Burnt orange: colour166 (#d75f00)
# Light amber: colour214 (#ffaf00)
# Cream text: colour223 (#ffd7af)
# Dark bg: colour234 (#1c1c1c)
# Pane borders
set -g pane-border-style fg=colour94
set -g pane-active-border-style fg=colour208
# Status bar position
set -g status-position bottom
# Status bar colors (dark amber background)
set -g status-style bg=colour52,fg=colour223
# Status bar left (bright orange accent)
set -g status-left-length 30
set -g status-left '#[fg=colour16,bg=colour208,bold] #S #[fg=colour208,bg=colour52] '
# Status bar right
set -g status-right-length 60
set -g status-right '#[fg=colour214] %H:%M #[fg=colour16,bg=colour166,bold] %d-%b '
# Window status
setw -g window-status-format '#[fg=colour214] #I:#W '
setw -g window-status-current-format '#[fg=colour208,bold] #I:#W* '
# Window with activity
setw -g window-status-activity-style fg=colour202,bg=colour52,bold
# Message style
set -g message-style bg=colour208,fg=colour16,bold
# Mode style (copy mode, etc)
set -g mode-style bg=colour166,fg=colour16
# Clock
set -g clock-mode-colour colour208
# --------------------------------------------
# Quick Actions
# --------------------------------------------
# Kill pane without confirmation
bind x kill-pane
# Kill window without confirmation
bind X kill-window
# Toggle zoom on current pane
bind z resize-pane -Z
# --------------------------------------------
# Session shortcuts
# --------------------------------------------
bind S choose-session
bind N new-session
# --------------------------------------------
# AI CLI Swap (prefix + A)
# Kills current process in pane and lets you pick a new CLI
# --------------------------------------------
bind A send-keys C-c \; run-shell "sleep 0.2" \; send-keys "~/.config/tmux/swap-cli.sh" Enter
# --------------------------------------------
# Copy mode (vim-style)
# --------------------------------------------
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send -X copy-selection-and-cancel
# macOS clipboard integration
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "pbcopy"
# ============================================
# NEW FEATURES
# ============================================
# --------------------------------------------
# Dev Layout (prefix + D)
# Creates: tree (top-left) / git (bottom-left) | editor (right)
# --------------------------------------------
bind D split-window -h -b -l 35% -c "#{pane_current_path}" \; \
split-window -v -c "#{pane_current_path}" \; \
select-pane -R \; \
send-keys -t "{top-left}" "watch -n 2 -c 'tree -C -L 2 --dirsfirst'" Enter \; \
send-keys -t "{bottom-left}" "watch -n 3 -c 'git status --short 2>/dev/null; echo \"\"; git diff --stat HEAD 2>/dev/null | tail -15'" Enter \; \
display "Dev layout ready!"
# Alternative: Three equal columns (prefix + T)
bind T split-window -h -c "#{pane_current_path}" \; \
split-window -h -c "#{pane_current_path}" \; \
select-layout even-horizontal \; \
display "Triple pane layout!"
# --------------------------------------------
# Sync Panes Toggle (prefix + y)
# Type in all panes simultaneously - great for multi-server
# --------------------------------------------
bind y setw synchronize-panes \; display "Sync #{?synchronize-panes,ON,OFF}"
# --------------------------------------------
# Window Swapping (prefix + < / >)
# Move windows left and right
# --------------------------------------------
bind -r < swap-window -t -1 \; select-window -t -1
bind -r > swap-window -t +1 \; select-window -t +1
# Quick window switching (Alt + number, no prefix)
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-4 select-window -t 4
bind -n M-5 select-window -t 5
# --------------------------------------------
# Activity Monitoring
# Get notified when something happens in background windows
# --------------------------------------------
setw -g monitor-activity on
set -g visual-activity off
set -g activity-action other
# Bell settings
set -g visual-bell off
set -g bell-action other
# --------------------------------------------
# Session Persistence (tmux-resurrect)
# To enable, install TPM and tmux-resurrect:
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Then press prefix + I to install plugins
# --------------------------------------------
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
# Resurrect settings
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-strategy-nvim 'session'
# Continuum settings (auto-save every 15 min)
set -g @continuum-restore 'off'
set -g @continuum-save-interval '15'
# Initialize TPM (keep at bottom)
run '~/.tmux/plugins/tpm/tpm'
# --------------------------------------------
# Bonus: Quick Commands
# --------------------------------------------
# Clear pane history (prefix + C)
bind C send-keys -R \; clear-history \; display "Cleared!"
# Break pane to new window (prefix + B)
bind B break-pane
# Join pane from window (prefix + @)
bind @ command-prompt -p "Join pane from window:" "join-pane -s ':%%'"
# --------------------------------------------
# Focus events (for vim/neovim autoread)
# --------------------------------------------
set -g focus-events on
# --------------------------------------------
# Window Title (shows in terminal title bar)
# Shows: folder [command] (branch)
# --------------------------------------------
set-option -g set-titles on
set-option -g set-titles-string '#{b:pane_current_path} → #{pane_current_command}'
# Also update status bar window names to show project + command
setw -g automatic-rename on
setw -g automatic-rename-format '#{b:pane_current_path}:#{pane_current_command}'
# --------------------------------------------
# Auto Dev Layout on New Session & Window
# Layout: tree (top-left) / git (bottom-left) | editor (right)
# --------------------------------------------
# DISABLED - using ~/.config/tmux/dev-session.sh instead
# set-hook -g session-created '...'
# set-hook -g after-new-window '...'