forked from x/ContextOS
113 lines
3.3 KiB
Bash
113 lines
3.3 KiB
Bash
# 配置管理{{{
|
|
set -g prefix C-s
|
|
|
|
set -g base-index 1
|
|
set -g display-panes-time 5000
|
|
set -g display-time 5000
|
|
setw -g pane-base-index 1
|
|
|
|
set -g mode-keys vi
|
|
set -g history-limit 1000
|
|
|
|
set -g base-index 1
|
|
set -g display-panes-time 5000
|
|
set -g display-time 5000
|
|
|
|
|
|
set -g allow-rename off
|
|
set -g renumber-windows on
|
|
|
|
bind Space command-prompt
|
|
# }}}
|
|
# 会话管理{{{
|
|
bind s choose-tree -u
|
|
bind d confirm-before "detach-client"
|
|
# }}}
|
|
# 窗口管理{{{
|
|
bind c new-window
|
|
bind w choose-window
|
|
bind q confirm-before kill-window
|
|
|
|
bind f command-prompt -p "find window:" "find-window -N '%%'"
|
|
bind C-F command-prompt -p "find window:" "find-window '%%'"
|
|
bind e command-prompt -p "window new name:" "rename-window '%%'"
|
|
bind m command-prompt -p "move window from:,move window to:" "swap-window -s %% -t %%"
|
|
|
|
bind o last-window
|
|
bind n next-window
|
|
bind p previous-window
|
|
# }}}
|
|
# 面板管理{{{
|
|
bind i display-panes
|
|
bind x confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
|
|
|
bind b break-pane
|
|
# bind u split-window
|
|
# bind v split-window -h
|
|
# bind C-u split-window -f
|
|
# bind C-v split-window -f -h
|
|
bind u split-window -c "#{pane_current_path}"
|
|
bind v split-window -h -c "#{pane_current_path}"
|
|
bind C-u split-window -f -c "#{pane_current_path}"
|
|
bind C-v split-window -f -h -c "#{pane_current_path}"
|
|
|
|
bind h select-pane -L
|
|
bind l select-pane -R
|
|
bind j select-pane -D
|
|
bind k select-pane -U
|
|
|
|
bind C-o confirm-before -p "kill all other pane(y/n)?" "kill-pane -a"
|
|
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-m command-prompt -p "swap pane from:,swap pane to:" "swap-pane -s %% -t %%"
|
|
# }}}
|
|
# 缓存管理{{{
|
|
bind C-s copy-mode
|
|
bind C-d clear-history
|
|
|
|
bind a choose-buffer
|
|
bind z paste-buffer
|
|
# }}}
|
|
# 命令管理{{{
|
|
bind @ confirm-before "source-file ~/.tmux.conf"
|
|
bind ! command-prompt "run-shell %%"
|
|
# }}}
|
|
|
|
# tmux 1.x or other {{{
|
|
if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -lt '2' ]" "\
|
|
set -g mouse-select-window on; \
|
|
set -g mouse-select-pane on; \
|
|
set -g mouse-resize-pane on; \
|
|
set -g mode-mouse on; \
|
|
" "\
|
|
set -g mouse on; \
|
|
"
|
|
# }}}
|
|
# tmux-2.6 or other{{{
|
|
if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` = '2' -a `tmux -V |cut -d' ' -f2|cut -d'.' -f2` = '6' ]" "\
|
|
bind -T copy-mode-vi e send-keys -X scroll-down; \
|
|
bind -T copy-mode-vi y send-keys -X scroll-up; \
|
|
bind -T copy-mode-vi d send-keys -X halfpage-down; \
|
|
bind -T copy-mode-vi u send-keys -X halfpage-up; \
|
|
bind -T copy-mode-vi f send-keys -X page-down; \
|
|
bind -T copy-mode-vi b send-keys -X page-up; \
|
|
bind -T copy-mode-vi v send-keys -X begin-selection; \
|
|
bind -T copy-mode-vi c send-keys -X copy-selection; \
|
|
" "\
|
|
bind -t vi-copy e scroll-down; \
|
|
bind -t vi-copy y scroll-up; \
|
|
bind -t vi-copy d halfpage-down; \
|
|
bind -t vi-copy u halfpage-up; \
|
|
bind -t vi-copy f page-down; \
|
|
bind -t vi-copy b page-up; \
|
|
bind -t vi-copy v begin-selection; \
|
|
bind -t vi-copy c copy-selection; \
|
|
bind -t vi-edit C-n history-down; \
|
|
bind -t vi-edit C-p history-up; \
|
|
bind -t vi-edit C-b cursor-left; \
|
|
bind -t vi-edit C-f cursor-right; \
|
|
"
|
|
# }}}
|