Created
October 6, 2025 15:57
-
-
Save tobert/7f9bd794ee7f25882b0bcfbbfc4771c4 to your computer and use it in GitHub Desktop.
my latest tmux.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tmux configuration inspired by screen workflow | |
# minimal keybindings, vim-style navigation | |
# Clear all default keybindings first | |
unbind -a | |
# Set prefix to Control-a (like screen) | |
# I also map my caps lock to control | |
set -g prefix C-a | |
unbind C-b | |
bind C-a last-window | |
bind a send-prefix | |
# Enable 256 color support | |
set -g default-terminal "screen-256color" | |
set -ga terminal-overrides ",xterm-256color:Tc" | |
# Start windows and panes at 1, not 0 | |
set -g base-index 1 | |
setw -g pane-base-index 1 | |
# Renumber windows when closing | |
set -g renumber-windows on | |
# History buffer size (like screen's defscrollback 8192) | |
set -g history-limit 8192 | |
# No delay for escape key press | |
set -sg escape-time 0 | |
# Mouse support disabled - keyboard only | |
set -g mouse off | |
# Enable terminal title updates | |
set -g set-titles on | |
set -g set-titles-string "#{pane_current_path} - #T" | |
# Vim-style pane navigation | |
bind h select-pane -L | |
bind j select-pane -D | |
bind k select-pane -U | |
bind l select-pane -R | |
# Arrow key pane navigation (fallback) | |
bind Left select-pane -L | |
bind Down select-pane -D | |
bind Up select-pane -U | |
bind Right select-pane -R | |
# Direct window access with numbers (like screen) | |
bind 1 select-window -t 1 | |
bind 2 select-window -t 2 | |
bind 3 select-window -t 3 | |
bind 4 select-window -t 4 | |
bind 5 select-window -t 5 | |
bind 6 select-window -t 6 | |
bind 7 select-window -t 7 | |
bind 8 select-window -t 8 | |
bind 9 select-window -t 9 | |
bind 0 select-window -t 10 | |
# Window navigation (vim-style and arrows) | |
bind -n M-h previous-window | |
bind -n M-l next-window | |
bind -n M-Left previous-window | |
bind -n M-Right next-window | |
# Window list (like screen's "Control-a ") | |
bind '"' choose-window | |
# Split panes with | and - | |
bind | split-window -h | |
bind - split-window -v | |
unbind % | |
# Reload config | |
bind r source-file ~/.tmux.conf \; display-message "Config reloaded!" | |
# Keep essential bindings | |
bind c new-window | |
bind d detach-client | |
bind n next-window | |
bind p previous-window | |
bind q kill-pane | |
bind Q kill-window | |
bind C-z suspend-client | |
# Status line configuration | |
set -g status on | |
set -g status-interval 1 | |
set -g status-position bottom | |
set -g status-justify left | |
# Status line colors (Tokyo Night theme) | |
set -g status-style bg=colour238,fg=colour147 | |
# Left status: session name | |
set -g status-left-length 20 | |
set -g status-left '[#S] ' | |
# Right status: pwd, CPU usage, memory, date/time | |
set -g status-right-length 120 | |
set -g status-right '#{pane_current_path} | #{?#{!=:#T,},#T | ,}CPU:#(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk "{printf \"%3.0f%%\", 100 - \$1}") MEM:#(free | grep Mem | awk "{printf \"%3.0f%%\", \$3/\$2 * 100.0}") | %Y-%m-%d %H:%M' | |
# Window status format | |
setw -g window-status-format ' #I #W ' | |
setw -g window-status-current-format ' #I #W ' | |
setw -g window-status-current-style bg=colour75,fg=colour235,bold | |
setw -g window-status-style fg=colour146 | |
# Pane border colors | |
set -g pane-border-style fg=colour238 | |
set -g pane-active-border-style fg=colour75 | |
# Message colors | |
set -g message-style bg=colour75,fg=colour235 | |
# Copy mode (vim-style) | |
setw -g mode-keys vi | |
bind [ copy-mode | |
bind ] paste-buffer | |
# Auto-detach like screen | |
set -g detach-on-destroy off | |
# Bell/notification settings (like screen's vbell off) | |
set -g visual-bell off | |
set -g bell-action none | |
# Default shell (like screen's defshell) | |
set -g default-shell /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment