tmux 配置

以下是 ~/.tmux.conf 文件的內(nèi)容,主要是修改了默認(rèn)的快捷鍵,ctrl+b改為ctrl+a。
退出改為了ctrl+a, q,其余的可以參見(jiàn)配置。

用tmux -V查詢版本,這是tmux 3.1c的配置。

git 倉(cāng)庫(kù)地址:dev-config

github上有個(gè)更好的說(shuō)明文檔: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                      #開(kāi)啟狀態(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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Tmux是一個(gè)終端復(fù)用器,網(wǎng)上配置要多少有多少,但是秉承“自己的才是最好的”原則,我決定照葫蘆畫瓢寫一份自己的Tm...
    左藍(lán)閱讀 4,607評(píng)論 12 38
  • -- base settings --# Add truecolor support set-option -ga...
    jesseyu閱讀 747評(píng)論 0 0
  • 官網(wǎng) 中文版本 好的網(wǎng)站 Content-type: text/htmlBASH Section: User ...
    不排版閱讀 4,725評(píng)論 0 5
  • tmux可以干什么 ssh遠(yuǎn)程到服務(wù)器后,執(zhí)行一個(gè)費(fèi)時(shí)的操作,斷開(kāi)ssh后任務(wù)可以繼續(xù)執(zhí)行,不會(huì)中斷 ssh到遠(yuǎn)程...
    比軒閱讀 14,725評(píng)論 2 61
  • 這個(gè)教程的目的是為了更好地使用tmux,作為一個(gè)小白,看了網(wǎng)上眾多的資料后,感覺(jué)資料太多,質(zhì)量也良莠不齊。在you...
    赤樂(lè)君閱讀 49,607評(píng)論 2 18

友情鏈接更多精彩內(nèi)容