forked from x/ContextOS
118 lines
3.3 KiB
Bash
118 lines
3.3 KiB
Bash
# 配置管理 {{{
|
|
set -g prefix C-s
|
|
|
|
set -g base-index 1
|
|
set -g pane-base-index 1
|
|
set -g renumber-windows on
|
|
|
|
set -g display-time 5000
|
|
set -g display-panes-time 5000
|
|
set -g history-limit 1000
|
|
set -g mode-keys vi
|
|
|
|
set -gw other-pane-width 60
|
|
set -gw other-pane-height 15
|
|
|
|
# 标题栏
|
|
set -g set-titles on
|
|
set -g set-titles-string "#h/#S:#W.#P"
|
|
|
|
set -g mode-fg white
|
|
set -g mode-bg red
|
|
set -g message-fg white
|
|
set -g message-bg black
|
|
set -g pane-active-border-fg cyan
|
|
set -g pane-active-border-bg blue
|
|
|
|
# 状态栏
|
|
set -g status-bg blue
|
|
set -g status-fg white
|
|
set -g allow-rename off
|
|
set -g status-interval 1
|
|
set -g status-left-length 60
|
|
set -g status-left "#[bg=red fg=white]\ [#h/#S]\ #[bg=yellow fg=black]\ [#{pane_height},#{pane_width}]\ #[bg=red]"
|
|
set -g status-right "#[bg=red]\ [#(date '+%Y-%m-%d %H:%M:%S')]\ "
|
|
set -g status-right-length 60
|
|
|
|
set -gw window-status-separator ""
|
|
set -gw window-status-format "#[bg=blue fg=white]\ [#I:#W.#{pane_index}#F]\ "
|
|
set -gw window-status-current-format "#[bg=red fg=white]\ [#I:#W.#{pane_index}#F#{?pane_in_mode,COPY,}]\ "
|
|
|
|
# }}}
|
|
# 会话管理{{{
|
|
bind s choose-tree -u
|
|
bind q confirm-before "detach-client"
|
|
# }}}
|
|
# 窗口管理{{{
|
|
bind b break-pane
|
|
bind c new-window
|
|
bind e command-prompt -p "window new name:" "rename-window '%%'"
|
|
bind B command-prompt -p "target window:" "join-pane -v -t %%"
|
|
|
|
bind m choose-tree -suw -c "swap-window -t %%"
|
|
bind p previous-window
|
|
bind n next-window
|
|
bind o last-window
|
|
# }}}
|
|
# 面板管理{{{
|
|
bind i display-panes
|
|
bind x confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
|
bind z resize-pane -Z
|
|
bind v split-window -h
|
|
bind u split-window
|
|
|
|
bind h select-pane -L
|
|
bind l select-pane -R
|
|
bind j select-pane -D
|
|
bind k select-pane -U
|
|
|
|
bind C-g select-layou tiled
|
|
bind C-y select-layou main-vertical
|
|
bind C-t select-layou main-horizontal
|
|
bind C-h command-prompt -p "size:" "resize-pane -L %%"
|
|
bind C-l command-prompt -p "size:" "resize-pane -R %%"
|
|
bind C-j command-prompt -p "size:" "resize-pane -D %%"
|
|
bind C-k command-prompt -p "size:" "resize-pane -U %%"
|
|
bind C-o confirm-before -p "kill all other pane(y/n)?" "kill-pane -a"
|
|
# }}}
|
|
# 缓存管理{{{
|
|
bind C-s copy-mode
|
|
bind C-d clear-history
|
|
bind \; paste-buffer
|
|
|
|
bind r choose-buffer
|
|
bind a paste-buffer
|
|
|
|
bind -t vi-copy c copy-selection
|
|
bind -t vi-copy Space begin-selection
|
|
# }}}
|
|
# 命令管理{{{
|
|
bind Space command-prompt
|
|
|
|
bind -t vi-edit C-p history-up
|
|
bind -t vi-edit C-n history-down
|
|
bind -t vi-edit C-f cursor-right
|
|
bind -t vi-edit C-b cursor-left
|
|
bind -t vi-edit C-j enter
|
|
# }}}
|
|
|
|
if-shell "[ -e ~/.tmux_local ]" "source-file ~/.tmux_local"
|
|
|
|
# set -g status-fg white
|
|
# set -g status-bg black
|
|
# set -g status-left "#[bg=black fg=white]\ [#h/#S]\ #[bg=black fg=white]\ [#{pane_height},#{pane_width}]\ #[bg=black]"
|
|
# set -g status-right "#[bg=black fg=white]\ [#(date '+%Y-%m-%d %H:%M:%S')]\ "
|
|
# set -gw window-status-format "#[bg=black fg=white]\ [#I:#W.#{pane_index}#F]\ "
|
|
# set -gw window-status-current-format "#[bg=black fg=white]\ [#I:#W.#{pane_index}#F#{?pane_in_mode,COPY,}]\ "
|
|
# set -g mode-fg white
|
|
# set -g mode-bg white
|
|
# set -g message-fg white
|
|
# set -g message-bg black
|
|
# set -g pane-border-fg white
|
|
# set -g pane-border-bg black
|
|
# set -g pane-active-border-fg white
|
|
# set -g pane-active-border-bg black
|
|
# set -g display-panes-active-colour white
|
|
# set -g display-panes-colour white
|
|
|