tmux cheatsheet

Notation: <prefix> x = press prefix, then x. Default prefix C-b; mine C-s. Columns: Action, stock default key, my binding. = no stock default.

Sessions

ActionDefaultMine
detach (leave session)dd
session listss
new session:newC-c
find session (prompt → switch)C-f
last sessionLBTab (shift-tab)

Windows

ActionDefaultMine
new windowcc
rename window,,
kill window&&
previous windowpC-h
next windownC-l
swap window leftC-S-h
swap window rightC-S-l
last active windowlTab

Panes

ActionDefaultMine
kill panexx
zoom panezz
split vertical"-
split horizontal%_
navigate L/D/U/Rarrowsh/j/k/l
resize L/D/U/RC-arrowsH/J/K/L (+2)
swap pane with next}>
swap pane with previous{<

Copy mode (vi)

ActionDefaultMine
enter copy mode[Enter
begin selectionSpacev
rectangle togglevC-v
copy selection + exitEntery
start of line0 / ^H
end of line$L
cancelqEscape

Misc

ActionDefaultMine
reload config (~/.tmux.conf)r
mouseoffon

Common CLI

# new session
tmux new -s <name>
# new session, detached
tmux new -s <name> -d
# attach session
tmux attach -t <name>
# list sessions
tmux ls
# kill session
tmux kill-session -t <name>
# new window (tab) in session
tmux new-window -t <session>
# rename window
tmux rename-window <name>
# send keys to pane
tmux send-keys -t <target> '<cmd>' Enter
# kill server
tmux kill-server