diff --git a/etc/dotsfile/.tmux.conf b/etc/dotsfile/.tmux.conf index d053e457..1955f0c3 100644 --- a/etc/dotsfile/.tmux.conf +++ b/etc/dotsfile/.tmux.conf @@ -87,8 +87,25 @@ if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -lt '2' ]" "\ set -g mouse-select-pane on; \ set -g mouse-resize-pane on; \ "# }}} -# tmux 2.x{{{ +# tmux 2.x# {{{ if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -gt '1' ]" "\ + set -g mouse on; \ + " +# }}} +# tmux 2.3{{{ +if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` = '2' -a `tmux -V |cut -d' ' -f2|cut -d'.' -f2` = '3']" "\ + # bind -T copy-mode-vi y send-keys -X scroll-down; \ + # bind -T copy-mode-vi e 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; \ + " +# }}} +# tmux 2.6{{{ +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 y send-keys -X scroll-down; \ bind -T copy-mode-vi e send-keys -X scroll-up; \ bind -T copy-mode-vi d send-keys -X halfpage-down; \ @@ -97,6 +114,5 @@ if-shell "[ `tmux -V |cut -d' ' -f2|cut -d'.' -f1` -gt '1' ]" "\ 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; \ - set -g mouse on; \ " # }}} diff --git a/usr/wiki/zsh_tmux_vim.md b/usr/wiki/zsh_tmux_vim.md index ac279cf9..4a0544ef 100644 --- a/usr/wiki/zsh_tmux_vim.md +++ b/usr/wiki/zsh_tmux_vim.md @@ -150,6 +150,11 @@ Ctrl+b d $ tmux ``` +如下按下Ctrl+b,然后再按问号?,就可以查看所有快捷键。可以按方向键上下翻页,按字母q可以退出查看。 +``` +Ctrl+b ? +``` + #### tmux命令行体验 tmux的控制方式除了方便的快捷键,还有丰富的命令行。 @@ -170,6 +175,23 @@ $ tmux list-sessions $ tmux attach-session ``` +除了在外部终端命令行中执行tmux命令,还可以在tmux中执行命令,按Ctrl+b然后按冒号,就进入底行模式,然后就可以输入各种命令,最后按回车执行。 +``` +Ctrl+b : split-window +``` +显示时间,按任意键退出。 +``` +Ctrl+b : clock-mode +``` +显示状态条 +``` +Ctrl+b : set status on +``` +隐藏状态条 +``` +Ctrl+b : set status on +``` + #### tmux客户端与会话 tmux是以CS的服务模型实现窗口管理。 tmux的后台服务,负责管理客户端与会话的连接。可以同时管理多个会话,多个客户端,所以可以支持多个人同时连接服务。 @@ -314,6 +336,29 @@ visual-silence word-separators +#### tmux缓存管理 +list-buffers +show-buffer +save-buffer +load-buffer +set-buffer +delete-buffer +choose-buffer +paste-buffer +clear-history + +#### tmux状态行 +display-message +confirm-before +command-prompt + +#### tmux其它命令 +clock-mode +server-info +lock-server +if-shell +run-shell +wait-for #### tmux缓存管理