Configs tmux

A starter tmux config, explained line by line

Rebind the prefix to C-o

C-b collides with readline backward-char muscle memory and demands a left-pinky stretch from home row. C-o doesn’t — your left pinky already lives there. Rebinding the prefix is the single highest-value tweak on this page: every other tmux shortcut you know shifts over with it.

send-prefix keeps an escape hatch for passing a literal C-o through to programs inside tmux.

unbind C-b
set -g prefix C-o
bind C-o send-prefix

WHERE: ~/.tmux.conf — reload with tmux source-file ~/.tmux.conf, or start a new session.

Turn on mouse support

Scroll with the wheel, click to switch panes, drag to select and copy. Purists turn it off so they can hold Shift for native terminal selection; everyone else just leaves it on and occasionally holds Shift.

set -g mouse on

WHERE: ~/.tmux.conf — reload with tmux source-file ~/.tmux.conf.

Raise the scrollback limit

tmux keeps 2,000 lines of history by default, which is why "scroll up and find the stack trace" fails. history-limit sets the maximum number of lines held in pane history, so raising it lets you scroll further back. To see the limit a pane is using, run tmux display -p '#{history_limit}' in that pane. In our test on tmux 3.5a, panes that were already open kept the old limit.

set -g history-limit 100000

WHERE: ~/.tmux.conf — reload with tmux source-file ~/.tmux.conf.

Vi keys in copy mode

Copy mode defaults to emacs bindings, which is a personal insult if your fingers already know hjkl. This makes the mode vi-flavored and adds v for visual selection. y copies the selection into tmux’s paste buffer. Whether it also reaches your system clipboard depends on your terminal and tmux’s set-clipboard option. From then on, <prefix> [ feels like your editor instead of a hostage situation.

set -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

WHERE: ~/.tmux.conf — reload with tmux source-file ~/.tmux.conf.

Reload the config with <prefix> r

Once you’re editing tmux.conf regularly, this round-trips the file without killing the server. Type the reload command once in your config so the key exists on every future reload — after that, config edits are a two-keystroke affair.

bind r source-file ~/.tmux.conf \; display "Reloaded"

WHERE: ~/.tmux.conf — the first time, reload with tmux source-file ~/.tmux.conf; after that, just press <prefix> r.

Matching the prefix in other multiplexers (herdr)

Same argument as entry 1, and if you run both tmux and herdr, matching them means one prefix in your fingers instead of two. One line in herdr’s config file, no unbind dance needed — the setting replaces the default outright. This works with any binding in the keys.* table, and the same file drives herdr’s themes, sidebar, and notifications. (from the herdr docs, not tested)

Tip: herdr --default-config prints a fully commented starting config — pipe it to the file and edit from there. herdr config check validates your file if herdr starts complaining.

[keys]
prefix = "ctrl+o"

WHERE: ~/.config/herdr/config.toml (create the file if it doesn’t exist) — reload a running server with herdr server reload-config, or just restart herdr.