tmux 配置

以下是 ~/.tmux.conf 文件的内容,主要是修改了默认的快捷键,ctrl+b改为ctrl+a。
退出改为了ctrl+a, q,其余的可以参见配置。

用tmux -V查询版本,这是tmux 3.1c的配置。

git 仓库地址:dev-config

github上有个更好的说明文档: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                   #提示信息的持续时间;设置足够的时间以避免看不清提示,单位为毫秒
set-option -g repeat-time 1000                    #控制台激活后的持续时间;设置合适的时间以避免每次操作都要先激活控制台,单位为毫秒
set-option -g status-keys vi                      #操作状态栏时的默认键盘布局;可以设置为vi或emacs
#set-option -g status-right "#(date +%H:%M' ')"    #状态栏右方的内容;这里的设置将得到类似23:59的显示
set-option -g status-right-length 10              #状态栏右方的内容长度;建议把更多的空间留给状态栏左方(用于列出当前窗口)
#set-option -g status-utf8 on                      #开启状态栏的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
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 219,366评论 6 508
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,521评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 165,689评论 0 356
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,925评论 1 295
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,942评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,727评论 1 305
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,447评论 3 420
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,349评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,820评论 1 317
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,990评论 3 337
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,127评论 1 351
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,812评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,471评论 3 331
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 32,017评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,142评论 1 272
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,388评论 3 373
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 45,066评论 2 355

推荐阅读更多精彩内容

  • Tmux是一个终端复用器,网上配置要多少有多少,但是秉承“自己的才是最好的”原则,我决定照葫芦画瓢写一份自己的Tm...
    左蓝阅读 4,487评论 12 38
  • -- base settings --# Add truecolor support set-option -ga...
    jesseyu阅读 614评论 0 0
  • 官网 中文版本 好的网站 Content-type: text/htmlBASH Section: User ...
    不排版阅读 4,383评论 0 5
  • tmux可以干什么 ssh远程到服务器后,执行一个费时的操作,断开ssh后任务可以继续执行,不会中断 ssh到远程...
    比轩阅读 14,348评论 2 61
  • 这个教程的目的是为了更好地使用tmux,作为一个小白,看了网上众多的资料后,感觉资料太多,质量也良莠不齐。在you...
    赤乐君阅读 48,938评论 2 18