Every tmux command
you actually need, on one page.
Reference
Every binding below is shown with your prefix. Pick one and the whole page updates.
Your prefixtmux default
Sessions
12Long-lived workspaces. Detach, reattach, never lose state.
-
$ tmuxStart a new session -
$ tmux new -s <name>Start a named session -
$ tmux lsList running sessions -
$ tmux attachAttach to last session -
$ tmux attach -t <name>Attach to a specific session -
$ tmux kill-session -t <name>Kill a session by name -
$ tmux kill-serverKill the tmux server and all sessions - C-bthendDetach from current session
- C-bthensShow session tree
- C-bthen$Rename current session
- C-bthen(Switch to previous session
- C-bthen)Switch to next session
Windows
10Tabs within a session. One per task.
- C-bthencCreate a new window
- C-bthen,Rename current window
- C-bthen&Close current window
- C-bthenwList all windows
- C-bthennNext window
- C-bthenpPrevious window
- C-bthen0Switch to window 0 (1–9 for others)
- C-bthenlToggle to last window
- C-bthenfFind window by name
- C-bthen.Move window to new index
Panes
13Split the current window. Code, logs, tests side by side.
- C-bthen%Split pane vertically
- C-bthen"Split pane horizontally
- C-bthenoCycle to next pane
- C-bthen;Toggle to last active pane
- C-bthen←/→/↑/↓Move to pane in direction
- C-bthen{Swap with previous pane
- C-bthen}Swap with next pane
- C-bthenxClose current pane
- C-bthenzToggle pane zoom (fullscreen)
- C-bthen!Break pane into a new window
- C-bthenqShow pane numbers
- C-bthenspaceCycle through pane layouts
- C-bthenCtrl+←/→/↑/↓Resize pane in direction
Copy Mode
11Scroll, search, and yank text without a mouse.
- C-bthen[Enter copy mode
- qQuit copy mode
- spaceStart selection
- enterCopy selection to tmux buffer
- C-bthen]Paste from buffer
- C-bthen=List and choose from paste buffers
- /Search forward
- ?Search backward
- nNext search match
- gJump to top
- GJump to bottom
Misc & Help
6The small commands that save you from Googling.
- C-bthen?Show all key bindings
- C-bthen:Open tmux command prompt
- C-bthentShow a big clock in current pane
- C-bthenrReload tmux config (custom binding)
- C-bthen~Show tmux messages
- C-bthenDChoose a client to detach
Config A sensible
A sensible .tmux.conf to start from.
Drop this in ~/.tmux.conf, reload, and you've got the
defaults most users end up with anyway.
~/.tmux.conf
# ~/.tmux.conf — a sensible starting point
# Use Ctrl-a instead of Ctrl-b
unbind C-b
set -g prefix C-a
bind C-a send-prefix
# Start window and pane indexes at 1
set -g base-index 1
setw -g pane-base-index 1
# Reload config
bind r source-file ~/.tmux.conf \; display "reloaded"
# Split panes using | and -
bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}"
# Vim-style pane navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Mouse on
set -g mouse on
# More history
set -g history-limit 50000
# True color
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
One-pager
The whole sheet on one page. Print it.
Stick it on the wall next to your monitor. The print layout hides the rest of the site.
tmux cheat sheet
Prefix: C-b
Sessions
-
$ tmuxStart a new session -
$ tmux new -s <name>Start a named session -
$ tmux lsList running sessions -
$ tmux attachAttach to last session -
$ tmux attach -t <name>Attach to a specific session -
$ tmux kill-session -t <name>Kill a session by name -
$ tmux kill-serverKill the tmux server and all sessions - C-bthend Detach from current session
- C-bthens Show session tree
- C-bthen$ Rename current session
- C-bthen( Switch to previous session
- C-bthen) Switch to next session
Windows
- C-bthenc Create a new window
- C-bthen, Rename current window
- C-bthen& Close current window
- C-bthenw List all windows
- C-bthenn Next window
- C-bthenp Previous window
- C-bthen0 Switch to window 0 (1–9 for others)
- C-bthenl Toggle to last window
- C-bthenf Find window by name
- C-bthen. Move window to new index
Panes
- C-bthen% Split pane vertically
- C-bthen" Split pane horizontally
- C-btheno Cycle to next pane
- C-bthen; Toggle to last active pane
- C-bthen←/→/↑/↓ Move to pane in direction
- C-bthen{ Swap with previous pane
- C-bthen} Swap with next pane
- C-bthenx Close current pane
- C-bthenz Toggle pane zoom (fullscreen)
- C-bthen! Break pane into a new window
- C-bthenq Show pane numbers
- C-bthenspace Cycle through pane layouts
- C-bthenCtrl+←/→/↑/↓ Resize pane in direction
Copy Mode
- C-bthen[ Enter copy mode
- q Quit copy mode
- space Start selection
- enter Copy selection to tmux buffer
- C-bthen] Paste from buffer
- C-bthen= List and choose from paste buffers
- / Search forward
- ? Search backward
- n Next search match
- g Jump to top
- G Jump to bottom
Misc & Help
- C-bthen? Show all key bindings
- C-bthen: Open tmux command prompt
- C-bthent Show a big clock in current pane
- C-bthenr Reload tmux config (custom binding)
- C-bthen~ Show tmux messages
- C-bthenD Choose a client to detach
tmux.sheet Start:
tmux new -s work · Reattach: tmux a -t work