-
Notifications
You must be signed in to change notification settings - Fork 0
/
tmux-cheatsheet.txt
175 lines (110 loc) · 5.89 KB
/
tmux-cheatsheet.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
-------------------------------------
Sessions
-------------------------------------
$ tmux start a new session
$ tmux new start a new session
$ tmux new-session start a new session
: new start a new session
$ tmux new -s mysession start a new session with the name mysession
: new -s mysession start a new session with the name mysession
$ tmux kill-ses -t mysession kill/delete session mysession
$ tmux kill-session -t mysession kill/delete session mysession
$ tmux kill-session -a kill/delete all sessions but the current
Ctrl + b $ rename session
Ctrl + b d detach from session
: attach -d detach others on the session (Maximize window by detach other clients)
$ tmux ls show all sessions
$ tmux list-sessions show all sessions
Ctrl + b s show all sessions
$ tmux a -t mysession attach to a session with the name mysession
$ tmux at -t mysession attach to a session with the name mysession
$ tmux attach -t mysession attach to a session with the name mysession
$ tmux attach-session -t mysession attach to a session with the name mysession
Ctrl + b w preview session and window
Ctrl + b ( move to previous session
Ctrl + b ) move to next session
-------------------------------------
Windows
-------------------------------------
Ctrl + b c preview session and window
Ctrl + b , rename current window
Ctrl + b & close current window
Ctrl + b p go to previous window
Ctrl + b n go to next window
Ctrl + b 0 ... 9 switch/select window by number
: swap-window -s 2 -t 1 reorder window, swap window number 2 (src) and 1 (dst)
: swap-window -t -1 move current window to the left by one position
-------------------------------------
Panes
-------------------------------------
Ctrl + b ; toggle last active pane
Ctrl + b % split pane horizontally
Ctrl + b " split pane vertically
Ctrl + b { move the current pane left
Ctrl + b } move the current pane right
Ctrl + b up-arrow switch to pane to the direction
Ctrl + b down-arrow switch to pane to the direction
Ctrl + b right-arrow switch to pane to the direction
Ctrl + b left-arrow switch to pane to the direction
: setw synchronize-panes toggle synchronize-panes (send command to all panes)
Ctrl + b Spacebar toggle between pane layouts
Ctrl + b o switch to next pane
Ctrl + b q show pane numbers
Ctrl + b q 0 ... 9 switch/select pane by number
Ctrl + b z toggle pane zoom
Ctrl + b ! convert pane into a window
Ctrl + b + up-arrow resize current pane height (holding second key is optional)
Ctrl + b Ctrl + up-arrow resize current pane height (holding second key is optional)
Ctrl + b + down-arrow resize current pane height (holding second key is optional)
Ctrl + b Ctrl + down-arrow resize current pane height (holding second key is optional)
Ctrl + b + right-arrow resize current pane width (holding second key is optional)
Ctrl + b Ctrl + right-arrow resize current pane width (holding second key is optional)
Ctrl + b + left-arrow resize current pane width (holding second key is optional)
Ctrl + b Ctrl + left-arrow resize current pane width (holding second key is optional)
Ctrl + b x close current pane
-------------------------------------
Copy mode (vi mode)
-------------------------------------
: setw -g mode-keys vi use vi keys in buffer
Ctrl + b [ enter copy mode
Ctrl + b PgUp enter copy mode and scroll one page up
q quit mode
g go to top line
G go to bottom line
up-arrow scroll up
down-arrow scroll down
h move cursor left
j move cursor down
k move cursor up
l move cursor right
w move cursor forward one word at a time
b move cursor backward one word at a time
/ search forward
? search backward
n next keyword occurance
N previous keyword occurance
Spacebar start selection
Esc clear selection
Enter copy selection
Ctrl + v toggle selection mode: line <-> rectangle
Ctrl + b ] paste contents of buffer_0
: show-buffer display buffer_0 contents
: capture-pane copy entire visible contents of pane to a buffer
: list-buffers show all buffers
: choose-buffer show all buffers and paste selected
: save-buffer buf.txt save buffer contents to buf.txt
: delete-buffer -b 1 delete buffer_1
-------------------------------------
Misc
-------------------------------------
Ctrl + b : enter command mode
: set -g OPTION set OPTION for all sessions
: setw -g OPTION set OPTION for all windows
: set mouse on enable mouse mode
-------------------------------------
Help
-------------------------------------
$ tmux list-keys list key bindings(shortcuts)
: list-keys list key bindings(shortcuts)
Ctrl + b ? list key bindings(shortcuts)
tmux info show every session, window, pane, etc...