Tmux cheatsheet

doitian 2,821 views 9 slides Sep 03, 2013
Slide 1
Slide 1 of 9
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9

About This Presentation

No description available for this slideshow.


Slide Content

Tmux Cheatsheet

A Tmux Session

Help
C-b ?
see all key bindings
tmux list-commands
list tmux sub commands
man tmux
tmux manual

Session Management
tmux new -s session_name
creates a new tmux session named session_name
tmux attach -t session_name
attaches to an existing tmux session named
session_name
tmux attach -t session_name -r
attaches in readonly mode
tmux switch -t session_name
switches to an existing session named session_name
tmux detach (C-b d)
detach the currently attached session
tmux list-sessions
lists existing tmux sessions
A session can have many windows. And the session can be shared by multiple clients, the screen is
synchronized among all clients.

Window Management
A window runs a command (shell by default)

C-b c
creates a new shell window
tmux new-window vi
creates a new window to run vi
C-b ,
change window name
C-b p
previous window
C-b n
next window
C-b &
kill window, or just C-d to exit shell, :q to exit vi

C-b #
# is digit from 0 to 9: choose window #
C-b w
choose window from menu
In menu:
C-p previous line
C-n next line
ESC cancel
Enter confirm selection

Select Window Menu

Pane Management
C-b “
Create new pane under current pane
C-b %
Create new pane on the right of current pane
tmux split-window -h vi
Split horizontal and run vi in it
C-b Left, C-b Right, C-b Up, C-b Down
Go to pane by direction
C-b C-Left, C-b C-Right, C-b C-Up, C-b C-Down
Resize the pane
C-b M-Left, C-b M-Right, C-b M-Up, C-b M-Down
Resize the pane in 5x steps

A window can be split into panes. By default new window has only one pane occupying all spaces.

Window/Pane History
C-p, C-n
move by line
C-f, C-b
move by char
Page Up, Page Down
previous window
C-s
search forward, ENTER to submit search
C-r
seasrch backward, ENTER to submit search


n
continue last search forward
p
continue last search backward
set-window-option -g mode-keys vi
use vi binding in copy mode
C-b [ start copy mode to scroll back, use following keybinding in copy mode
ESC exit copy mode

Copy Mode