
Installation
$ cd
$ git clone https://github.com/gpakosz/.tmux.git
$ ln -s -f .tmux/.tmux.conf
$ cp .tmux/.tmux.conf.local .
Key-Bindings
<prefix>Ctrl + a or Ctrl + b<prefix> cCtrl + a + c<prefix> C-cCtrl + a + Ctrl + c<prefix> ?manual<prefix> ddetached the current session<ctrl> +dkill current session<prefix> dclose current panel
This configuration uses the following bindings:
<prefix> eopens~/.tmux.conf.local<prefix> rreloads~/.tmux.conf.localC-lclears both the screen and the tmux history
Session Operation:
<prefix> C-ccreates a new session<prefix> C-flets you switch to another session by name<prefix> $rename session name<prefix> slist sessions
Windows Operation:
<prefix> C-hand<prefix> C-llet you navigate windows<prefix> ccreate window<prefix> wlist windows<prefix> Tabbrings you to the last active window<prefix> 1,2,3let you navigate to specific window<prefix> ,rename current window<prefix> &close current window<prefix> ffind specific window by name
Panel Operation:
<prefix> /splits the current pane vertically<prefix> -splits the current pane horizontally<prefix> h,<prefix> j,<prefix> kand<prefix> llet you navigate<prefix> onavigate panels<prefix> H,<prefix> J,<prefix> K,<prefix> Llet you resize panes<prefix> <and<prefix> >let you swap panes<prefix> +maximizes the current pane to a new panel<prefix> xkill the current panel<prefix> mtoggles mouse mode on or off<prefix> <space>切换窗格布局<prefix> Enterenters copy-mode<prefix> blists the paste-buffers<prefix> ppastes from the top paste-buffer<prefix> Plets you choose the paste-buffer to paste from
Configuration
file: ~/.tmux.conf.local
variables:
tmux_conf_theme_left_separator_main='\uE0B0'
tmux_conf_theme_left_separator_sub='\uE0B1'
tmux_conf_theme_right_separator_main='\uE0B2'
tmux_conf_theme_right_separator_sub='\uE0B3'
Configuring the status line
Edit the ~/.tmux.conf.local file (<prefix> e) and adjust thetmux_conf_theme_status_left and tmux_conf_theme_status_right variables to
your own preferences.
This configuration supports the following builtin variables:
#{battery_bar}: horizontal battery charge bar#{battery_percentage}: battery percentage#{battery_status}: is battery charging or discharging?#{battery_vbar}: vertical battery charge bar#{circled_session_name}: circled session number, up to 20#{hostname}: SSH/Mosh aware hostname information#{hostname_ssh}: SSH/Mosh aware hostname information, blank when not
connected to a remote server through SSH/Mosh#{loadavg}: load average#{pairing}: is session attached to more than one client?#{prefix}: is prefix being depressed?#{root}: is current user root?#{synchronized}: are the panes synchronized?#{uptime_y}: uptime years#{uptime_d}: uptime days, modulo 365 when#{uptime_y}is used#{uptime_h}: uptime hours#{uptime_m}: uptime minutes#{uptime_s}: uptime seconds#{username}: SSH/Mosh aware username information#{username_ssh}: SSH aware username information, blank when not connected
to a remote server through SSH/Mosh
Beside custom variables mentioned above, the tmux_conf_theme_status_left andtmux_conf_theme_status_right variables support usual tmux syntax, e.g. using#() to call an external command that inserts weather information provided by
wttr.in:
tmux_conf_theme_status_right='#{prefix}#{pairing}#{synchronized} #(curl wttr.in?format=3) , %R , %d %b | #{username}#{root} | #{hostname} '

Accessing the macOS clipboard from within tmux sessions
[Chris Johnsen created the reattach-to-user-namespace
utility][reattach-to-user-namespace] that makes pbcopy and pbpaste work
again within tmux.
To install reattach-to-user-namespace, use either MacPorts or
Homebrew:
$ port install tmux-pasteboard
or
`$ brew install reattach-to-user-namespace`
Once installed, reattach-to-usernamespace will be automatically detected.
tmux终端复用神器
Tmux 快捷键
多窗口管理器Tmux - 从入门到精通
优雅地使用命令行:Tmux 终端复用
[结对编程利器:SSH和Tmux]
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 askding@qq.com