|
|
@@ -0,0 +1,124 @@
|
|
|
+# vim: set fdm=marker foldenable:
|
|
|
+
|
|
|
+########## 基本设置 ---{{{
|
|
|
+#
|
|
|
+# 把 prefix 设置成与 screen 相同,实际上也更好摁一些
|
|
|
+set -g prefix C-a
|
|
|
+unbind-key C-b
|
|
|
+bind-key a send-prefix
|
|
|
+
|
|
|
+set -g buffer-limit 20000;
|
|
|
+
|
|
|
+# 快捷键采用 vi 模式
|
|
|
+setw -g mode-keys vi
|
|
|
+
|
|
|
+# 设置默认 Shell 为 bash
|
|
|
+set -g default-shell /bin/bash
|
|
|
+# }}}
|
|
|
+
|
|
|
+########## 终端属性设置 ---{{{
|
|
|
+# 全面开启鼠标支持,鼠标可以用来选择窗口及面板,调整面板尺寸,以及复制文本
|
|
|
+set -g mouse on
|
|
|
+
|
|
|
+# Use xterm function key sequence
|
|
|
+setw -g xterm-keys on
|
|
|
+
|
|
|
+# 默认终端
|
|
|
+set -g default-terminal "xterm-256color"
|
|
|
+# Terminal overrides
|
|
|
+set -g set-clipboard on
|
|
|
+set -g terminal-overrides "*88col*:colors=88,*256col*:colors=256,xterm*:colors=256,*256col*:Tc,*:Ms"
|
|
|
+
|
|
|
+# 这个不能关,关了进了 vim 再退出屏幕画面不会恢复到进入之前
|
|
|
+setw -g alternate-screen on
|
|
|
+# }}}
|
|
|
+
|
|
|
+########## 状态栏设置 ---{{{
|
|
|
+#
|
|
|
+# 开启状态栏,并在接下来定制状态栏样式
|
|
|
+set -g status on
|
|
|
+# 不关心其它窗口的事件,对强迫症来说太烦人了
|
|
|
+setw -g monitor-activity off
|
|
|
+# 每隔 10 秒刷新一次状态栏
|
|
|
+set -g status-interval 10
|
|
|
+# 状态栏的窗口列表靠左显示
|
|
|
+set -g status-justify left
|
|
|
+# 状态栏的整体色调背景色为蓝色
|
|
|
+set -g status-bg blue
|
|
|
+# 状态栏左部最大长度不超过 32
|
|
|
+set -g status-left-length 32
|
|
|
+# 状态栏左部的格式: 红色的主机名(#h),然后是亮品红的日期时间
|
|
|
+set -g status-left "#[fg=magenta,bold]%m-%d %H:%M #[fg=brightyellow,bold]#{session_name} #[fg=red,bold]| "
|
|
|
+# 状态栏右部最大长度不超过 32
|
|
|
+set -g status-right-length 32
|
|
|
+# 状态栏右部显示内容
|
|
|
+set -g status-right "#[fg=brightyellow]| #(~/bin/start-ui LOGO)#[default]"
|
|
|
+# 状态栏窗口列表中,每个窗口的显示格式: 绿色的编号(#I)及窗口名称(#W)
|
|
|
+setw -g window-status-format '#[fg=green]#I-#W#[default]'
|
|
|
+# 状态栏窗口列表中,当前窗口的显示格式: 黄色的编号(#I)及窗口名称(#W)
|
|
|
+setw -g window-status-current-format '#[fg=brightyellow]#I-#W#[default]'
|
|
|
+# 状态栏窗口列表中,有事件的窗口的显示风格
|
|
|
+setw -g window-status-activity-style fg=red,bold,bg=default
|
|
|
+# 状态栏窗口列表中,有喇叭的窗口的显示风格
|
|
|
+setw -g window-status-bell-style fg=red,bold,bg=default
|
|
|
+# tmux 的信息也会显示在状态栏,包括 tmux 的命令行
|
|
|
+set -g message-style fg=brightyellow,bold,bg=red
|
|
|
+# 设置信息显示时间
|
|
|
+set -g display-time 1000
|
|
|
+# }}}
|
|
|
+
|
|
|
+########## 窗口管理 ---{{{
|
|
|
+set -g detach-on-destroy off
|
|
|
+### }}}
|
|
|
+
|
|
|
+########## 窗口管理 ---{{{
|
|
|
+#
|
|
|
+# 窗口的索引值从 0 开始
|
|
|
+set -g base-index 0
|
|
|
+# 关闭中间的会自动重新编号
|
|
|
+# set -g renumber-windows on
|
|
|
+
|
|
|
+# 类似于 screen,用 Ctrl+C 创建窗口,故意映射两组,防止按错
|
|
|
+bind-key C-c new-window -c '#{pane_current_path}'
|
|
|
+bind-key c new-window -c '#{pane_current_path}'
|
|
|
+
|
|
|
+# 自动设置窗口标题,一旦主动设置过窗口标题,则此窗口不会再次自动设置名称
|
|
|
+setw -g automatic-rename on
|
|
|
+
|
|
|
+# 通过 Ctrl+n / Ctrl+p 来切换窗口
|
|
|
+bind-key C-n next-window
|
|
|
+bind-key n next-window
|
|
|
+bind-key C-p previous-window
|
|
|
+bind-key p previous-window
|
|
|
+
|
|
|
+# 快速在两个窗口之间切换
|
|
|
+bind-key C-a last-window
|
|
|
+
|
|
|
+# 显示所有窗口,以供跳转
|
|
|
+unbind-key l
|
|
|
+bind-key l choose-window
|
|
|
+# }}}
|
|
|
+
|
|
|
+########## 面板管理 ---{{{
|
|
|
+#
|
|
|
+# 显示面板编号,方便跳转,以及通过样式得知哪个是当前面板
|
|
|
+bind-key m display-pane
|
|
|
+bind-key C-m display-pane
|
|
|
+
|
|
|
+set -g display-panes-time 3000
|
|
|
+set -g display-panes-active-colour brightblack
|
|
|
+set -g display-panes-colour brightyellow
|
|
|
+
|
|
|
+# 通过 v 和 h 来切分窗口,或者更直观一些用 - 和 |
|
|
|
+unbind %
|
|
|
+unbind '"'
|
|
|
+bind | split-window -h -c '#{pane_current_path}'
|
|
|
+bind h split-window -h -c '#{pane_current_path}'
|
|
|
+bind - split-window -v -c '#{pane_current_path}'
|
|
|
+bind v split-window -v -c '#{pane_current_path}'
|
|
|
+
|
|
|
+bind-key o last-pane
|
|
|
+bind-key C-o last-pane
|
|
|
+bind-key w select-pane -t :.+
|
|
|
+bind-key Tab select-pane -t :.+
|
|
|
+# }}}
|