tmux 配置文件

5 篇文章 0 订阅
5 篇文章 0 订阅
#
# author   : Xu Xiaodong <xxdlhy@gmail.com>
# modified : 2012 Jul 22
#

#-- base settings --#
set -g default-terminal "screen-256color"
set -g display-time 3000
set -g escape-time 0
set -g history-limit 65535
set -g base-index 1
set -g pane-base-index 1

#-- bindkeys --#
# prefix key (Ctrl+a)
set -g prefix ^x
unbind ^b
bind a send-prefix

# split window
unbind '"'
# vertical split (prefix -)
bind - splitw -v
unbind %
bind | splitw -h # horizontal split (prefix |)

# select pane
bind k selectp -U # above (prefix k)
bind j selectp -D # below (prefix j)
bind h selectp -L # left (prefix h)
bind l selectp -R # right (prefix l)

# resize pane
bind -r ^k resizep -U 10 # upward (prefix Ctrl+k)
bind -r ^j resizep -D 10 # downward (prefix Ctrl+j)
bind -r ^h resizep -L 10 # to the left (prefix Ctrl+h)
bind -r ^l resizep -R 10 # to the right (prefix Ctrl+l)

# swap pane
# swap with the previous pane (prefix Ctrl+u)
bind ^u swapp -U
# swap with the next pane (prefix Ctrl+d)
bind ^d swapp -D

#bind 1 select-window -t:1
bind-key -n "C-Left" select-window -t :-
bind-key -n "C-Right" select-window -t :+

# zoom pane <-> window
# #http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/examples/tmux-zoom.sh
bind ^z run "tmux-zoom"

# misc
# select the last pane (prefix e)
bind e lastp
# select the last window (prefix Ctrl+e)
bind ^e last
# kill pane (prefix q)
bind q killp
# kill window (prefix Ctrl+q)
bind ^q killw

# copy mode
# enter copy mode (prefix Escape)
bind Escape copy-mode
# paste buffer (prefix Ctrl+p)
bind ^p pasteb
# select (v)
bind -t vi-copy v begin-selection
# copy (y)
bind -t vi-copy y copy-selection

# zoom pane <-> window
#http://tmux.svn.sourceforge.net/viewvc/tmux/trunk/examples/tmux-zoom.sh
bind ^z run "tmux-zoom"

# app
# htop (prefix !)
#bind ! splitw htop
# man (prefix m)
bind m command-prompt "splitw 'exec man %%'"
# perl func (prefix @)
bind @ command-prompt "splitw 'exec perldoc -t -f %%'"
# perl var (prefix *)
bind * command-prompt "splitw 'exec perldoc -t -v %%'"
# perl doc (prefix %)
bind % command-prompt "splitw 'exec perldoc -t %%'"
# ruby doc (prefix /)
bind / command-prompt "splitw 'exec ri %%'"

# reload config (prefix r)
bind r source ~/.tmux.conf \; display "Configuration reloaded!"

#-- statusbar --#
set -g status-utf8 on
set -g status-interval 1
set -g status-keys vi

setw -g mode-keys vi
setw -g automatic-rename off

#-- colorscheme --#
#https://github.com/daethorian/conf-tmux/blob/master/colors/zenburn.conf

# modes
setw -g clock-mode-colour colour223
setw -g mode-attr bold
setw -g mode-fg colour223
setw -g mode-bg colour235

# panes
set -g pane-border-bg colour234
set -g pane-border-fg colour234
set -g pane-active-border-bg colour232
set -g pane-active-border-fg colour232

# statusbar
set -g status-justify centre
set -g status-bg colour235
set -g status-fg colour248
set -g status-attr dim
#[default]» #[fg=colour187]#S #[default]• #[fg=colour187]w#I.p#P#[default]"
#set -g status-left "
set -g status-left-attr bright
set -g status-left-length 20
#[fg=colour174]#(/home/xiaodong/bin/uptime) #[default]• #[fg=colour174]#(cut -d ' ' -f 1-3 /proc/loadavg)"
#set -g status-right "
set -g status-right-attr bright
set -g status-right-length 80

setw -g window-status-current-fg colour223
setw -g window-status-current-bg colour237
setw -g window-status-current-attr bold
setw -g window-status-current-format "#I:#W#F"

#setw -g window-status-alert-attr bold
#setw -g window-status-alert-fg colour255
#setw -g window-status-alert-bg colour160

# messages
set -g message-attr bold
set -g message-fg colour223
set -g message-bg colour235
set -g visual-activity on

# 快捷调整窗口分割到全屏
unbind m
bind m new-window -d -n tmp \; swap-pane -s tmp.1 \; select-window -t tmp
unbind n
bind n last-window \; swap-pane -s tmp.1 \; kill-window -t tmp

这里写代码片
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值