分页: 1 / 1

tmux 配置笔记(有图)

发表于 : 2010-10-15 15:47
zoujichun
* 简介
o tmux 是screen 一个替代品,优点是比screen 配置简单,并且功能不比screen 弱; tmux 默认就有下面的statusbar ,下面显示正在运行的程序名字,当然screen 也可以配置成这样。
* 配置学习
o 配置文件位置,/etc/tmux.conf, ~/.tmux.conf
o 修改默认的prefix key,默认的Ctrl-b 与vim 冲突,在~/.tmux.conf 添加如下内容:

unbind C-b
set -g prefix ^L # 将prefix key 改为 Ctrl-l
bind a send-prefix

o 打开utf8 支持,statusbar 也支持utf8,在~/.tmux.conf 添加如下内容:

set -g status-utf8 on
setw -g utf8 on

o statusbar 自定义,具体可以查看man 文档,非常详细:

set -g status-right "#(date +'%Y-%m-%d %H:%M')"
set -g display-time 3000
set -g status-bg black
set -g status-fg blue
set-window-option -g window-status-current-attr bright,reverse
set-window-option -g window-status-current-bg blue
set-window-option -g window-status-current-fg black

o 自定义快捷键,以下是我的几个配置,仅供参考:

bind -n S-Down neww # Shift-Down 新建窗口
bind -n S-Left prev # Shift-Left 上个窗口
bind -n S-Right next # Shift-Down 下个窗口

o 会话共享,协同工作:

tmux new -s work # 创建名称为work 的会话
tmux attach -t work # attach work 会话

* 待研究
o 类似screen encoding 支持,支持自由切换语言变量。

原文链接: http://www.zoujichun.info/2010/10/15/linux_dt_tmux.html

Re: tmux 配置笔记(有图)

发表于 : 2010-10-15 19:36
thomasxie
:em11

Re: tmux 配置笔记(有图)

发表于 : 2010-10-16 21:38
laolang_cool
tmux 没有 screen 里的 fit 命令,所以好像所有 screen 都得一样大小和分辨率,这个有点不爽。

encoding 功能,tmux 应该没有,不知有什么工具可以取代?

Re: tmux 配置笔记(有图)

发表于 : 2010-10-16 21:58
zoujichun
laolang_cool 写了:tmux 没有 screen 里的 fit 命令,所以好像所有 screen 都得一样大小和分辨率,这个有点不爽。

encoding 功能,tmux 应该没有,不知有什么工具可以取代?
fit 功能我没需求,encoding 我用的比较多,再好好研究研究。