Cheatography
https://cheatography.com
Still work in progress, comments welcome.inspired by http://blog.hawkhost.com/2010/06/28/tmux-the-terminal-multiplexer/also interesting: https://github.com/aziz/tmuxinator
General
Control-a |
prefix key (default C-b) |
: |
interactive dialog (promt) |
d |
detach session |
tmux restore |
restore session |
: source-file ~/.tmux.conf |
reload .tmux.conf |
t |
big clock |
? |
list bindings |
Session handling
tmux |
start new |
tmux new -s myname |
start new with name |
tmux a -t |
reattach session (or at, or attach) |
tmux a -t myname |
reattach named session |
tmux ls |
list sessions |
tmux kill-session -t myname |
kill named session |
:new |
new session |
s |
list sessions |
$ |
name session |
tmux kill-server |
kill server and all sessions |
customizing tmux
set-option -g prefix C-a |
rebind the Ctrl-b prefix to Ctrl-a |
-g for global => every window |
bind-key C-a last-window |
switch to last active window |
To use hit Ctrl-a twice |
unbind % |
Remove default split binding |
bind | split-window -h |
bind vertical splitting to | |
bind – split-window -v |
bind horizontal splitting to - |
set -g status-bg black |
set -g status-fg white |
set -g status-left ‘#[fg=green]#H’ |
beginning of statusbar hostname in green |
set-window-option -g window-status-current-bg red |
current window shown in red |
set -g status-right ‘#[fg=yellow]#(uptime | cut -d “,” -f 2-)’ |
number of users and load average for computer |
setw -g monitor-activity on |
highlight window with new activity |
set -g visual-activity on |
show info on new activity |
setw -g automatic-rename on |
set window title to current command |
|
|
Basic Window Handling
c |
new window |
, |
rename window |
n |
next window |
p |
previous window |
l |
previously selected window |
w |
list all windows |
[0-9] |
move to window number [0-9] |
f [window name] |
find window |
: list-windows |
list windows |
& |
kill window |
. |
move window |
Advanced Window Handling
move-window [ −d] [ −s src-window] [ −t dst-window] |
swap-window [ -d] [ -s src-window] [ -t dst-window] |
Pane Window Handling
:joinp -s :2 |
move window 2 into a new pane in the current window |
:joinp -t :1 |
move the current pane into a new pane in window 1 |
Vim like commands
bind s split-window -v |
splitting |
bind v split-window -h |
splitting |
bind h select-pane -L |
motion keys |
bind j select-pane -D |
motion keys |
bind k select-pane -U |
motion keys |
bind l select-pane -R |
motion keys |
setw -g mode-keys vi |
vim motion keys while in copy mode |
bind - resize-pane -D 1 |
resize pane down by 1 |
bind + resize-pane -U 1 |
resize pane up by 1 |
bind < resize-pane -L 1 |
resize pane to left by 1 |
bind > resize-pane -R 1 |
resize pane to right by 1 |
|
|
Basic Pane Handling
v |
split vertically |
: split-window |
split horizontally |
o |
go to next pane (down-pane) |
q |
show pane number, press number to go to |
{ |
move current pane left |
} |
move current pane right |
x |
kill pane |
Advanced Pane Handling
<space> |
toggle through layouts |
break-pane |
take a pane and make own window |
-d |
focus stays |
resize-pane |
resize pane down |
(20) |
by 20 cells |
|
|
-U (20) |
resize up (by 20 cells) |
|
|
-L (20) |
resize left (by 20 cells) |
|
|
-R (20) |
resize right (by 20 cells) |
|
|
-t 2 20 |
pane with id 2 down by 20 |
|
|
... |
tmux info
? |
list bindings |
Set pane title |
printf '\033]2;%s\033\\' 'title goes here' |
|
Created By
Metadata
Favourited By
and 40 more ...
Comments
Bruno 08:56 14 Feb 14
Most important key is missing: Ctrl-b
bechtold, 23:59 27 Apr 14
Under customizing you see, that I bound it to Control-b. I thought this is so basic, one should know at least this. But I add it now. Thx
Tom 08:33 24 Nov 14
Hi you propably forgot the most important:
C-b :setw synchronize-panes
..which allows you to type simultaneously in different panes.
/Tom
bechtold, 12:21 4 Sep 15
Good thing, I will try and then add this. But so far I have not hat the situation where I needed this :-)
foobar 10:43 12 May 15
Why is this cheatsheet divided into 2 pages, when it could fit in 1?
bechtold, 12:22 4 Sep 15
I have no clue. I don't think that I have influence on this. This seems to be pdf-generation-magic.
aadibhumihar, 07:56 6 Jul 18
very good
Add a Comment
Related Cheat Sheets