tmux.conf

# 0 is too far from ` ;)
# 窗口编号从1开始计数,默认从0开始计数
set -g base-index 1

# Automatically set window title
# 窗口自动命名
set-window-option -g automatic-rename on
set-option -g set-titles on

#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000

setw -g mode-keys vi
# 2.3版本中,要改写为set -g mouse on
setw -g mode-mouse on
setw -g monitor-activity on

# v键:在水平方向分割出新的窗格
bind-key v split-window -h
# s键:在垂直方向分割出新的窗格
bind-key s split-window -v

# J键:窗格向下移动5个单位
bind-key J resize-pane -D 5
# K键:窗格向上移动5个单位
bind-key K resize-pane -U 5
# H键:窗格向左移动5个单位
bind-key H resize-pane -L 5
# L键:窗格向右移动5个单位
bind-key L resize-pane -R 5

# M键即Meta键,需要在XShell会话属性中开启alt键=Meta键
# Meta键+j:窗格向下移动
bind-key M-j resize-pane -D
# Meta键+k:窗格向上移动
bind-key M-k resize-pane -U
# Meta键+h:窗格向左移动
bind-key M-h resize-pane -L
# Meta键+l:窗格向右移动
bind-key M-l resize-pane -R

# Vim style pane selection
# h键:向左选择窗格
bind h select-pane -L
# j键:向下选择窗格
bind j select-pane -D 
# k键:向上选择窗格
bind k select-pane -U
# l键:向右选择窗格
bind l select-pane -R

# Use Alt-vim keys without prefix key to switch panes
# 不使用前缀组合键,进行窗格的移动
# Alt-h:选择左边窗格
bind -n M-h select-pane -L
# Alt-j:选择下边窗格
bind -n M-j select-pane -D 
# Alt-k:选择上边窗格
bind -n M-k select-pane -U
# Alt-l:选择右边窗格
bind -n M-l select-pane -R

# Use Alt-arrow keys without prefix key to switch panes
# 不使用前缀组合键,进行窗格的移动
# Alt+左方向键:选择左边窗格
bind -n M-Left select-pane -L
# Alt+右方向键:选择右边窗格
bind -n M-Right select-pane -R
# Alt+上方向键:选择上边窗格
bind -n M-Up select-pane -U
# Alt+下方向键:选择下边窗格
bind -n M-Down select-pane -D

# Shift arrow to switch windows
# 不起作用?
bind -n S-Left  previous-window
bind -n S-Right next-window

# No delay for escape key press
set -sg escape-time 0

# Reload tmux config
# 使配置文件即时生效
bind r source-file ~/.tmux.conf

# THEME
# 设置inactive窗口的背景色
set -g status-bg black
# 设置inactive窗口的前景色
set -g status-fg white
# 设置active窗口的背景色
set -g window-status-current-bg white
# 设置active窗口的前景色
set -g window-status-current-fg black
# 设置active窗口名称的字体为粗体
set -g window-status-current-attr bold
set -g status-interval 60
# 左边状态栏占30个单位
set -g status-left-length 30
# 左边状态栏:绿色字体显示当前用户名字
set -g status-left '#[fg=green](#S) #(whoami)'
# 右边状态栏:黄色字体显示系统平均负载,白色字体显示时间
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值