Slide 1

Slide 1 text

Tmux Cheatsheet

Slide 2

Slide 2 text

A Tmux Session

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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.

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

Select Window Menu

Slide 7

Slide 7 text

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.

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Copy Mode