1
0
mirror of https://shylinux.com/x/ContextOS synced 2025-04-25 16:58:06 +08:00

opt tmux.conf

This commit is contained in:
shaoying 2019-10-31 04:34:37 +08:00
parent 3ef7047f89
commit b5ffb8f179
2 changed files with 10 additions and 110 deletions

View File

@ -1,112 +1,11 @@
# 配置管理{{{
set -g prefix C-s
source-file ~/.tmux.common
set -g base-index 1
set -g display-panes-time 5000
set -g display-time 5000
setw -g pane-base-index 1
set -g mouse on
bind -t vi-copy C-c copy-selection -x
set -g mode-keys vi
set -g history-limit 1000
set status-right "#(date) #(hostname)"
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; \
"
# }}}
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

View File

@ -45,7 +45,6 @@ nnoremap <Leader>; :VimuxPromptCommand<CR>
" nnoremap <Leader>vx :VimuxInterruptRunner<CR>
Plug 'fatih/vim-go'
" Plug 'Blackrush/vim-gocode'
Plug 'chr4/nginx.vim'
Plug 'othree/html5.vim'
Plug 'godlygeek/tabular'
@ -217,6 +216,8 @@ function! BenchCode(cmd, arg)
exe "silent !bench " l:line
endfunction
highlight Comment cterm=reverse ctermfg=yellow
" autocmd BufReadPost * call BenchCode("counter", ["nopen", 1])
" autocmd BufWritePost * call BenchCode("counter", ["nsave", 1])
"}}}