常用快捷键

~/.tmux.conf 可修改 tmux 配置。

tmux: open a new session.
C-b -> C-a
C-b %: 左右分屏。改为-> C-a |
C-b ": 上下分屏。-> C-a -
C-b <arrow key>:在 panes 间移动。-> alt + arrow
exit or hit Ctrl-d:退出当前 pane。
C-b c: new window.
C-b p: previous window.
C-b n: next window.
C-b <number> : move to window n.
C-b ?: help message.
C-b z: make a pane go full screen. Hit C-b z again to shrink it back to its previous size
C-b C-<arrow key>: 调整当前 window 的大小。
C-b ,: 重命令当前 window。
<C-b> [ Start scrollback. You can then press <space> to start a selection and <enter> to copy that selection.

tmux new -s <session-name>: new session
tmux ls: list session
tmux attach -t <session_index> / <session_name>: attach session
tmux kill-session -t <session_index> / <session_name>: kill session tmux switch -t <session_index> / <session_name>: switch session tmux rename-session -t <session_name> <new-name>: rename session

自定义快捷键

C-b -> C-a
C-b % -> C-a |
C-b " -> C-a -
C-b <arrow key> -> alt <arrow key>

oh-my-zsh tmux 插件

zsh 自带了一个 tmux 插件,只要在.zshrc plugins=(… tmux) 增加 tmux.