.tmux.conf generator
Toggle what you want; every generated line is commented so you know exactly what it does. The defaults here are the ten fixes almost every tmux user makes eventually — start with them.
Want the reasoning? Read the sane tmux config, explained line by line.
options
prefix key
clipboard method
plugins (adds tpm)
~/.tmux.conf[download]
# ~/.tmux.conf — generated with tmuxcheatsheet.dev/config/generator
# every line explained; delete anything you don't want
##### core #####
# proper colors: tell tmux its own terminal type, and that the
# outer terminal can do 24-bit RGB (fixes washed-out themes)
set -g default-terminal "tmux-256color"
set -ga terminal-features ",*:RGB"
# mouse: wheel scrolling, click to focus panes, drag borders
set -g mouse on
# bigger scrollback (default is tiny; affects new panes)
set -g history-limit 50000
# vim/neovim friendliness: no Esc lag, focus events for
# autoread — resolves the classic :checkhealth warnings
set -sg escape-time 10
set -g focus-events on
# number windows/panes from 1 (matches keyboard order),
# renumber when one closes so there are no gaps
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
##### keybindings #####
# splits that look like the symbol, opening in the current dir
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
# reload this file with prefix r
bind r source-file ~/.tmux.conf \; display "config reloaded"
##### copy mode #####
# vi keys in copy mode; v selects, y copies (like vim)
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
# sync copies to the system clipboard via OSC 52
# (works over SSH in modern terminals)
set -g set-clipboard on
##### status bar #####
# quiet, readable status line
set -g status-style "bg=default,fg=colour244"
setw -g window-status-current-style "fg=colour114,bold"
set -g status-left "#[fg=colour114][#S] "
set -g status-left-length 30
set -g status-right "%H:%M"