tmux cheatsheet
A tmux cheatsheet based on my needs / findings and based on my config.
Session
tmux new -s session_name
: creates a new tmux session named session_nametmux attach -t session_name
: attaches to an existing tmux session named session_nametmux switch -t session_name
: switches to an existing session named session_nametmux list-sessions
: lists existing tmux sessionstmux detach (prefix + d)
: detach the currently attached session
Windows
tmux new-window (prefix + c)
: create a new windowtmux select-window -t :0-9 (prefix + 0-9)
: move to the window based on indextmux rename-window (prefix + ,)
: rename the current window
Panes: Actions
tmux split-window (prefix + |)
: splits the window into two vertical panestmux split-window -h (prefix + -)
: splits the window into two horizontal panestmux swap-pane -[UDLR] (prefix + { or })
: swaps pane with another in the specified directiontmux select-layout even-vertical (prefix + Alt+2)
: split panes evenly, verticaltmux select-layout even-horizontal (prefix + Alt+1)
: split panes evenly, horizontaltmux resize-pane -Z (prefix + z)
: toggle pane zoom(prefix + !)
: convert pane into a window:setw synchronize-panes (prefix + S)
: synchronize panes
Panes: Select
tmux select-pane -[UDLR]
: selects the next pane in the specified directiontmux select-pane -t :.+
: selects the next pane in numerical order(prefix + q)
: show pane numbers(prefix + q 0..9)
: switch/select pane by number
Misc
:setw synchronize-panes (prefix + S)
: keyboard input is sent to all panes
Copy Mode
(prefix + [)
: enter copy mode/
: search forward?
: search backwardn
: next keyword occuranceN
: previous keyword occuranceSpacebar
: start selectionEsc
: clear selectionEnter
: copy selection