tmux

cli
CommandDescription
tmuxStart a new session
tmux new -s <name>Start a new session with a name
tmux lsList all sessions
tmux attach -t <name>Attach to a named session
tmux kill-session -t <name>Kill a named session
tmux kill-session -aKill all sessions except current
tmux kill-serverKill the tmux server and all sessions

Key Bindings (prefix: Ctrl+b)

Sessions

KeyDescription
dDetach from session
$Rename current session
sList/switch sessions interactively
(Move to previous session
)Move to next session

Windows

KeyDescription
cCreate a new window
nMove to next window
pMove to previous window
wList windows
fFind window by name
,Rename current window
&Kill current window
0-9Switch to window by number

Panes

KeyDescription
%Split pane vertically
"Split pane horizontally
oMove to next pane
qShow pane numbers (type number to jump)
xKill current pane
zToggle pane zoom (fullscreen)
!Convert pane to window
{Move pane left
}Move pane right
SpaceCycle through pane layouts
Ctrl+↑/↓/←/→Resize pane in direction

Copy Mode

KeyDescription
[Enter copy mode (scroll/search)
]Paste buffer
/Search forward (in copy mode)
?Search backward (in copy mode)

Misc

KeyDescription
?List all key bindings
tShow clock
:Enter command mode

Useful Commands

CommandDescription
:setw synchronize-panesToggle sending input to all panes
:resize-pane -D 10Resize pane down by 10 cells
:source-file ~/.tmux.confReload tmux config

Config Snippets (~/.tmux.conf)

# Enable mouse support
set -g mouse on

# 256 color support
set -g default-terminal "screen-256color"

# Reload config with prefix + r
bind r source-file ~/.tmux.conf \; display "Reloaded!"

# Vi mode for copy
setw -g mode-keys vi