可以通过使用前缀键组合其他键来控制tmux,默认的前缀键为‘C-b’(Ctrl-b)。使用时先按下前缀键,然后再按下其他键。
默认快捷键列表
键 | 含义 |
---|---|
C-b | 发送前缀KEY。 |
C-z | 暂停当前的tmux client。 |
“ | 将当前的pane分割为上下两部分。 |
# | 列出所有的粘贴缓冲。 |
$ | 重命名当前的session。 |
% | 左右分割当前pane。 |
‘ | 弹出window的索引,用于切换window。 |
( | 将client绑定到前一个session。 |
) | 将client绑定到下一个session。 |
– | 删除最近复制的文本缓冲。 |
. | 显示索引,用于移动window。 |
: | 进入交互模式,向tmux发送命令。 |
; | 移动到前一个活跃的pane。 |
= | 进入交互模式,从列表中选择要按贴的缓冲。 |
D | 选择一个client,脱离。 |
L | 选择一个绑定的client返回上一个session。 |
[ | 进入复制模式或者历史查看模式。 |
] | 粘贴最近复制的文本缓冲。 |
d | 断开当前的client。 |
f | 打开一个提示,用于在当前的window中搜索文本。 |
i | 显示当前window的一些信息。 |
l | 移动到上一个选择的window。 |
n | 换到下一个window。 |
o | 选择当前window中的下一个pane。 |
p | 换到上一个window。 |
q | 简要显示pane的索引。 |
r | 强制重新绘制Client。 |
m | 标记当前的pane。(查看select-pane -m) |
M | 清除标记的pane。 |
s | 进入交互模式,为绑定的client选择一个的session。 |
{ | 交换当前pane与上一个pane。 |
} | 交换当前pane与下一个pane。 |
~ | 显示来自tmux的上一条信息(如果存在)。 |
Page Up | 进入复制模式,向上滚动一页。 |
Up, Down, Left, Right | 上下左右选择panel。 |
M-1 to M-5 | 使用5个预设的布局排序window: even-horizontal, even-vertical, main-horizontal, main-vertical, or tiled。 |
Space | 使用下一个布局排序pane。 |
M-n | 用钟或活动标记移动到下一个窗口。 |
M-p | 用钟或活动标记移动到上一个窗口。 |
与「WINDOW」有关的快捷键
w
进入Window选择模式。在列表显示所有的Window,选择一个Window,Enter进行切换。
c
创建一个新的Window。
,
重命名当前window。
&
结束当前window。
0-9
在0-9号Window之间切换。
与「PANE」有关的快捷键
!
将当前的pane从当前的Window中脱离,独立出来。
关闭或结束
x
结束当前pane
移动pane的位置
M-o
顺时针交换当前window中的pane的位置。
C-o
逆时针交换当前window中的pane的位置。
调整pane的大小
C-Up, C-Down, C-Left, C-Right
调整当前pane的大小,一步1格。
M-Up, M-Down, M-Left, M-Right
调整当前pane的大小,一步5格。
z
切换当前pane的状态:最大化、或者从最大化恢复到原有大小。
帮助及辅助信息
?
显示快捷键列表。
t
显示当前的时间。
修改快捷键绑定
tmux allows a command to be bound to most keys, with or without a prefix key. When specifying keys,
most represent themselves (for example ‘A’ to ‘Z’). Ctrl keys may be prefixed with ‘C-’ or ‘^’, and Alt
(meta) with ‘M-’. In addition, the following special key names are accepted: Up, Down, Left, Right,
BSpace, BTab, DC (Delete), End, Enter, Escape, F1 to F12, Home, IC (Insert), NPage/PageDown/PgDn,
PPage/PageUp/PgUp, Space, and Tab. Note that to bind the ‘”’ or ‘’’ keys, quotation marks are neces‐
sary, for example:
bind-key ‘”‘ split-window
bind-key “‘” new-window
Commands related to key bindings are as follows:
bind-key [-cnr] [-R repeat-count] [-t mode-table] [-T key-table] key command [arguments]
(alias: bind)
Bind key key to command. Keys are bound in a key table. By default (without -T), the key is
bound in the prefix key table. This table is used for keys pressed after the prefix key (for
example, by default ‘c’ is bound to new-window in the prefix table, so ‘C-b c’ creates a new
window). The root table is used for keys pressed without the prefix key: binding ‘c’ to
new-window in the root table (not recommended) means a plain ‘c’ will create a new window. -n
is an alias for -T root. Keys may also be bound in custom key tables and the switch-client -T
command used to switch to them from a key binding. The -r flag indicates this key may repeat,
see the repeat-time option.
If -t is present, key is bound in mode-table: the binding for command mode with -c or for normal
mode without. For keys in the vi-copy or emacs-copy tables, -R specifies how many times the
command should be repeated.
See the WINDOWS AND PANES section and the list-keys command for information on mode key bind‐
ings.
To view the default bindings and possible commands, see the list-keys command.
list-keys [-t mode-table] [-T key-table]
(alias: lsk)
List all key bindings. Without -T all key tables are printed. With -T only key-table.
With -t, the key bindings in mode-table are listed; this may be one of: vi-edit, emacs-edit,
vi-choice, emacs-choice, vi-copy or emacs-copy.
send-keys [-lMR] [-t target-pane] key …
(alias: send)
Send a key or keys to a window. Each argument key is the name of the key (such as ‘C-a’ or
‘npage’ ) to send; if the string is not recognised as a key, it is sent as a series of charac‐
ters. The -l flag disables key name lookup and sends the keys literally. All arguments are
sent sequentially from first to last. The -R flag causes the terminal state to be reset.
-M passes through a mouse event (only valid if bound to a mouse key binding, see MOUSE SUPPORT).
send-prefix [-2] [-t target-pane]
Send the prefix key, or with -2 the secondary prefix key, to a window as if it was pressed.
unbind-key [-acn] [-t mode-table] [-T key-table] key
(alias: unbind)
Unbind the command bound to key. -c, -n, -T and -t are the same as for bind-key. If -a is
present, all key bindings are removed.