Official site: https://github.com/tmux/tmux

cheat-sheet

tmux use prefix key (default: C-b)

General

KeyDescription
:interactive dialog (promt)
ddetach session
tmux restorerestore session
: source -file ~/.tmux.confreload .tmux.conf
tbig clock
?list bindings

Pane Handling

KeyDescription
%split vertically
"split horizontally
ogo to next pane (down- pane)
qshow pane number, press number to go to
{move current pane left
}move current pane right
xkill pane
<space>toggle through layouts
;last pane
zresize pane
M-Upresize pane up 5 row
C-Upresize pane up 1 row

Window Handling

KeyDescription
cnew window
,rename window
nnext window
pprevious window
lpreviously selected window
wlist all windows
[0-9]move to window number [0-9]
f [window name]find window
:list-windows list windows
&kill window
.move window

Session handling

KeyDescription
tmuxstart new
tmux new -s mynamestart new with name
tmux a -treattach session (or at, or attach)
tmux a -t mynamereattach named session
tmux lslist sessions
tmux kill-s ession -t mynamekill named session
:newnew session
slist sessions
$name session
tmux kill-s erverkill server and all sessions

customizing tmux

KeyDescription
set-option -g prefix C-arebind the Ctrl-b prefix to Ctrl-a ; -g
bind-key C-a last-windowswitch to last active window; To use hit Ctrl-a twice
unbind %Remove default split binding
bindsplit-window -h
bind - split-window -vbind vertical splitting to -
set -g status-bg blackset status bar bg color to black
set -g status-fg whiteset status bar fg color to white
set -g status-left ‘#[fg=green]#H’beginning of statusbar hostname in green
set -g status-right ‘#[fg=yellow]#(uptimecut -d “,” -f 2-)’
set-window-o ption -g window-status-current-bg redcurrent window shown in red
setw -g monito r-a ctivity onhighlight window with new activity
set -g visual -ac tivity onshow info on new activity
setw -g automatic -rename onset window title to current command

Default key bindings

The default command key bindings are:

C-b Send the prefix key (C-b) through to the application.
C-o Rotate the panes in the current window forwards.
C-z Suspend the tmux client.
!  Break the current pane out of the window.
" Split the current pane into two, top and bottom.
# List all paste buffers.
$ Rename the current session.
% Split the current pane into two, left and right.
& Kill the current window.
' Prompt for a window index to select.
( Switch the attached client to the previous session.
) Switch the attached client to the next session.
, Rename the current window.
- Delete the most recently copied buffer of text.
.  Prompt for an index to move the current window.
0 to 9 Select windows 0 to 9.
: Enter the tmux command prompt.
; Move to the previously active pane.
= Choose which buffer to paste interactively from a list.
?  List all key bindings.
D Choose a client to detach.
L Switch the attached client back to the last session.
[ Enter copy mode to copy text or view the history.
] Paste the most recently copied buffer of text.
c Create a new window.
d Detach the current client.
f Prompt to search for text in open windows.
i Display some information about the current window.
l Move to the previously selected window.
n Change to the next window.
o Select the next pane in the current window.
p Change to the previous window.
q Briefly display pane indexes.
r Force redraw of the attached client.
m Mark the current pane (see select-pane -m).
M Clear the marked pane.
s Select a new session for the attached client interactively.
t Show the time.
w Choose the current window interactively.
x Kill the current pane.
z Toggle zoom state of the current pane.
{ Swap the current pane with the previous pane.
} Swap the current pane with the next pane.
~ Show previous messages from tmux, if any.
Page Up Enter copy mode and scroll one page up.
Up, Down Left, Right Change to the pane above, below, to the left, or to the right of the current pane.
M-1 to M-5 Arrange panes in one of the five preset layouts: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled.
Space Arrange the current window in the next preset layout.
M-n Move to the next window with a bell or activity marker.
M-o Rotate the panes in the current window backwards.
M-p Move to the previous window with a bell or activity marker.
C-Up, C-Down C-Left, C-Right Resize the current pane in steps of one cell.
M-Up, M-Down M-Left, M-Right Resize the current pane in steps of five cells.

References