Skip to content

Instantly share code, notes, and snippets.

@bububa
Created December 27, 2012 19:08
Show Gist options
  • Save bububa/4391037 to your computer and use it in GitHub Desktop.
Save bububa/4391037 to your computer and use it in GitHub Desktop.
tmux
Ctrl+b " - split pane horizontally
Ctrl+b % - 将当前窗格垂直划分
Ctrl+b 方向键 - 在各窗格间切换
Ctrl+b,并且不要松开Ctrl,方向键 - 调整窗格大小
Ctrl+b c - (c)reate 生成一个新的窗口
Ctrl+b n - (n)ext 移动到下一个窗口
Ctrl+b p - (p)revious 移动到前一个窗口.
Ctrl+b 空格键 - 采用下一个内置布局
Ctrl+b q - 显示分隔窗口的编号
Ctrl+b o - 跳到下一个分隔窗口
Ctrl+b & - 确认后退出 tmux
~/.tmux/mylayout
selectp -t 0 #选中第0个窗格
splitw -h -p 50 #将其分成左右两个
selectp -t 1 #选中第一个,也就是右边那个
splitw -v -p 50 #将其分成上下两个,这样就变成了图中的布局了
selectp -t 0 #选回第一个
在.tmux.conf 后面加上一句
bind D source-file ~/.tmux/mylayout
结束,这样每次进入tmux后,键入 Ctrl + b D (D是大写,要按shrift,你也可以按成其他字符,只要跟tmux已经用的不冲突即可),即会自动执行mylayout脚本,生成图示布局。
.tmux.conf
鼠标可以选中窗格 set-option -g mouse-select-pane on
鼠标滚轮可以用 set-window-option -g mode-mouse on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment