tmux配置文件 .tmux.conf

#
# author   :
# modified : 
#

#-- base settings --#
set -g default-terminal "xterm-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 ^a
unbind ^b
bind a send-prefix

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

bind C-l send-keys 'C-l'

# 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)

# Smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"
bind C-l send-keys 'C-l'

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

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

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

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

# 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 --#
# see also: 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
set -g status-left "#[default]» #[fg=colour187]#S #[default]• #[fg=colour187]w#I.p#P#[default]"
set -g status-left-attr bright
set -g status-left-length 20
set -g status-right "#[fg=colour174]#(/home/xiaodong/bin/uptime) #[default]• #[fg=colour174]#(cut -d ' ' -f 1-3 /proc/loadavg)"
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


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要下载tmux配置文件,你可以按照以下步骤进行操作: 1. 首先,确保你的系统上已经安装了tmux。你可以使用包管理器(如apt、yum或brew)来安装tmux。例如,在Ubuntu上,你可以运行以下命令来安装tmux: ``` sudo apt-get install tmux ``` 2. 接下来,下载配置文件。你可以在Github等代码托管平台上找到很多现成的tmux配置文件。你可以根据自己的需求选择一个合适的配置文件。例如,你可以在Github上搜索“tmux config”并浏览搜索结果。 3. 找到一个适合你的配置文件后,你可以直接下载它。在Github上,你可以点击绿色的“Code”按钮,然后选择“Download ZIP”,将配置文件的zip包下载到你的本地。 4. 解压缩下载的zip包。你可以使用archive工具(如WinRAR、7-Zip)来解压缩文件。解压缩后,你会得到一个包含配置文件的文件夹。 5. 找到tmux配置文件。在解压缩后的文件夹中,你可能会找到一个或多个文件,带有`.tmux.conf`、`.tmux`或`tmux.conf`的名称。选择其中一个文件,并将其命名为`.tmux.conf`。 6. 将配置文件放置在正确的位置。将`.tmux.conf`文件复制到你的用户目录下(在Linux和macOS中为`~`,在Windows中为`C:\Users\你的用户名`)。 7. 然后,打开终端,并重新启动tmux。你将看到新应用的配置已经生效。 通过遵循以上步骤,你可以方便地下载并使用tmux配置文件。记得在使用之前备份你的现有配置文件,以防止出现问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值