Skip to content

tmux

tmux lets you run multiple terminal sessions in a single window with split panes and session persistence.

tmux with multiple panes
tmux status bar with window list
tmux with multiple panes

tmux with multiple panes

tmux status bar with window list

tmux status bar with window list

Config lives at ~/.config/tmux/tmux.conf.

SettingValue
PrefixCtrl + Space (also Ctrl + B)
Base index1 (windows and panes)
MouseEnabled
Copy modeVi keybindings
Status barTop position, themed
Colors256 color with RGB overrides

All prefixed bindings require pressing Ctrl + Space first.

ShortcutAction
Prefix + hSplit horizontally
Prefix + vSplit vertically
Ctrl + Alt + ArrowsNavigate panes
Ctrl + Alt + Shift + ArrowsResize panes
Prefix + xKill pane
ShortcutAction
Prefix + cNew window
Prefix + ,Rename window
Alt + 1-9Select window
Alt + ArrowsNavigate windows
ShortcutAction
Prefix + CNew session
Prefix + RRename session
Alt + Up/DownSwitch sessions

Enter copy mode with Prefix + [, then use Vi keys:

KeyAction
vBegin selection
yCopy selection

Preconfigured tmux session layouts for development:

CommandLayoutDescription
tdl [name] [dir]Editor + terminalnvim left (60%), terminal right
tdlm [name] [dir]Main devnvim top-left, terminal bottom-left, server right
tsl [name] [dir]Swarm4 equal panes
tdl myproject ~/code/myproject # editor + terminal
tdlm api ~/code/api # editor + terminal + server
tsl workers ~/code/workers # 4 panes for parallel work

If a session with that name already exists, the command reattaches to it.

Edit ~/.config/tmux/tmux.conf. The config uses Prefix + r to reload. Theme colors are managed by theme-set — switching themes updates tmux live.

The bash alias t attaches to an existing session or creates a new one:

t # attach or new session