以下是 ~/.tmux.conf 文件的內(nèi)容陵珍,主要是修改了默認(rèn)的快捷鍵哎榴,ctrl+b改為ctrl+a型豁。
退出改為了ctrl+a, q,其余的可以參見配置尚蝌。
用tmux -V查詢版本迎变,這是tmux 3.1c的配置。
git 倉(cāng)庫(kù)地址:dev-config
github上有個(gè)更好的說明文檔:https://gist.github.com/andreyvit/2921703
# use C-a, since it's on the home row and easier to hit than C-b
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix
set -g base-index 1
# vi is good
setw -g mode-keys vi
# mouse behavior
# setw -g mode-mouse on
# set -g mouse-select-pane on
# set -g mouse-resize-pane on
set -g history-limit 65535
# set-option -g default-terminal screen-256color
bind-key : command-prompt
bind-key r refresh-client
bind-key L clear-history
# bind-key space next-window
bind-key bspace previous-window
bind-key enter next-layout
# use vim-like keys for splits and windows
bind-key v split-window -h
bind-key s split-window -v
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key C-o rotate-window
bind-key + select-layout main-horizontal
bind-key = select-layout main-vertical
set-window-option -g other-pane-height 25
set-window-option -g other-pane-width 80
bind-key a last-pane
bind-key q display-panes
bind-key c new-window
# bind-key t next-window
# bind-key T previous-window
bind -n 'F11' previous-window
bind -n 'F12' next-window
# kill pane (prefix q)
bind q killp
# kill window (prefix Ctrl+q)
bind ^q killw
bind K killw
bind-key [ copy-mode
bind-key ] paste-buffer
# Clunkily connect tmux buffers with the pasteboard.
bind-key y run "tmux save-buffer - | reattach-to-user-namespace pbcopy"
#set-window-option display-panes-time 1500
set-option -g display-panes-time 1500
# Status Bar
set-option -g status-interval 1
set-option -g status-left ''
# set-option -g status-right '%H:%M%p'
set-option -g status-right '%H:%M'
#set-window-option -g window-status-current-fg magenta
set-option -g status-fg default
# test add
set-option -g display-time 5000 #提示信息的持續(xù)時(shí)間驼壶;設(shè)置足夠的時(shí)間以避免看不清提示氏豌,單位為毫秒
set-option -g repeat-time 1000 #控制臺(tái)激活后的持續(xù)時(shí)間;設(shè)置合適的時(shí)間以避免每次操作都要先激活控制臺(tái)热凹,單位為毫秒
set-option -g status-keys vi #操作狀態(tài)欄時(shí)的默認(rèn)鍵盤布局泵喘;可以設(shè)置為vi或emacs
#set-option -g status-right "#(date +%H:%M' ')" #狀態(tài)欄右方的內(nèi)容;這里的設(shè)置將得到類似23:59的顯示
set-option -g status-right-length 10 #狀態(tài)欄右方的內(nèi)容長(zhǎng)度般妙;建議把更多的空間留給狀態(tài)欄左方(用于列出當(dāng)前窗口)
#set-option -g status-utf8 on #開啟狀態(tài)欄的UTF-8支持
#set -g status-left "#[fg=colour52]#S #[fg=yellow]#I #[fg=cyan]#P"
#set -g status-left '#[fg=green]#H'
# Status Bar solarized-light
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g status-bg white"
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-active-border-fg white"
if-shell "[ \"$COLORFGBG\" = \"11;15\" ]" "set-option -g pane-border-fg white"
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on
# Enable native Mac OS X copy/paste
# set-option -g default-command "/bin/bash -c 'which reattach-to-user-namespace >/dev/null && exec reattach-to-user-namespace $SHELL -l || exec $SHELL -l'"
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 0
set -g pane-border-style fg=green
set -ga pane-border-style bg=black
set -g pane-active-border-style fg=white
set -ga pane-active-border-style bg=yellow
# Status Bar solarized-dark (default)
set-option -g status-bg black
set -g pane-active-border-style bg=default,fg=magenta
set -g pane-border-style fg=green
set -g message-style fg=white
set -ga message-style bg=black
set -ga message-style bright
setw -g window-status-style fg=cyan
setw -ga window-status-style bg=default
setw -ga window-status-style dim
setw -g window-status-current-style fg=white
setw -ga window-status-current-style bg=black
setw -ga window-status-current-style bright