# tmux Server Configuration # Minimal, plugin-free config optimized for remote servers # Prefix: Ctrl+/ (sends C-_) # Status bar: Bottom # ============================================================================= # Core Settings # ============================================================================= set -g mouse on set-option -a terminal-features 'XXX:RGB' set-option -sg escape-time 10 set-option -g focus-events on set-window-option -g mode-keys vi set-option -g renumber-windows on set -g visual-activity off set -ga update-environment TERM set -ga update-environment TERM_PROGRAM # Set base index to 1 set -g base-index 1 setw -g pane-base-index 1 # ============================================================================= # Prefix Key: Ctrl+/ (which sends C-_) # ============================================================================= set -g prefix C-_ unbind C-b bind C-_ send-prefix # ============================================================================= # Status Bar - Bottom Position # ============================================================================= set -g status-position bottom set -g status-interval 5 set -g status-justify left # Simple, readable status bar colors set -g status-style 'bg=#1e1e2e fg=#cdd6f4' set -g status-left-length 30 set -g status-right-length 50 set -g status-left '#[fg=#1e1e2e,bg=#89b4fa,bold] #S #[fg=#89b4fa,bg=#1e1e2e]' set -g status-right '#[fg=#6c7086]#H #[fg=#89b4fa]%H:%M ' # Window status set -g window-status-format '#[fg=#6c7086] #I:#W ' set -g window-status-current-format '#[fg=#1e1e2e,bg=#a6e3a1,bold] #I:#W#{?window_zoomed_flag,(),} ' set -g window-status-separator '' # Pane borders set -g pane-border-style 'fg=#313244' set -g pane-active-border-style 'fg=#89b4fa' # Message style set -g message-style 'bg=#89b4fa fg=#1e1e2e bold' # ============================================================================= # Key Bindings # ============================================================================= # Reload config unbind r bind r source-file ~/.tmux.conf \; display "Reloaded!" # Search with / and ? bind-key / copy-mode \; send-key ? # Vi copy mode bindings bind-key -T copy-mode-vi "v" send-keys -X begin-selection bind-key -T copy-mode-vi "y" send-keys -X copy-selection unbind -T copy-mode-vi MouseDragEnd1Pane # Split panes with | and - unbind % bind | split-window -h -c '#{pane_current_path}' unbind '"' bind - split-window -v -c '#{pane_current_path}' # Kill pane with Shift + Option + X bind -n M-X kill-pane # Attach session to current path unbind 'C' bind C attach-session -c "#{pane_current_path}" # Window movement with Left/Right arrows bind Left swap-window -t -1\; select-window -t -1 bind Right swap-window -t +1\; select-window -t +1 # Pane resize with hjkl bind -r j resize-pane -D 5 bind -r k resize-pane -U 5 bind -r l resize-pane -R 5 bind -r h resize-pane -L 5 # Pane minimize/maximize with m bind -r m resize-pane -Z # ============================================================================= # Pane Navigation (vim-style without plugin) # ============================================================================= # Smart pane switching with awareness of Vim splits is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'" bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L' bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D' bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U' bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R' bind-key -T copy-mode-vi 'C-h' select-pane -L bind-key -T copy-mode-vi 'C-j' select-pane -D bind-key -T copy-mode-vi 'C-k' select-pane -U bind-key -T copy-mode-vi 'C-l' select-pane -R bind-key -T copy-mode-vi 'C-\' select-pane -l