linux之tmux.config配置

#解绑ctrl+b快捷键
#unbind C-b

#更换前缀快捷键为ctrl+a
#set -g prefix C-a

#Tmux会话选项
set -g status-keys vi

#开启鼠标模式
# set -g mode-mouse on
# set -g monitor-activity on
# set -g xterm-keys on

#设置默认终端配色
# set -g default-terminal "screen-256color"

#自动重命名窗口名字
set -g automatic-rename on

#关闭窗口自动重新分配ID
set -g renumber-windows on

# 开启鼠标点击选择窗格
#set -g mouse-select-pane on
# 开启鼠标点击选择窗口
#set -g mouse-select-window on
# 开启鼠标调节窗格大小
#set -g mouse-resize-pane on

# 美化窗格栏
# set -g pane-active-border-bg    none
# set -g pane-active-border-fg    red

# set -g display-panes-active-colour red

# 美化信息栏
set -g message-bg blue
set -g message-fg white

# 美化命令行
set -g message-command-bg cyan
set -g message-command-fg white

# black blue red green yellow white cyan magenta

# 美化标题栏
# set -g status on
set -g status-position top
set -g status-fg black
set -g status-bg white
set -g status-justify centre
# set -g status-justify left
set -g status-left '#[fg=black,bold][#S]'
# set -g status-left-length 20
set -g status-right '#[fg=black,bold][%Y-%m-%d %H:%M]'
set -g window-status-format ' #[fg=black,bold]#I:#W '
set -g window-status-current-format ' #[fg=white,bold]* #I:#W *#[fg=black] '
set -g window-status-fg black
set -g window-status-bg white
set -g window-status-current-fg white
set -g window-status-current-bg black

#每当修改tmux.conf后 按ctrl+b r重新加载配置立即生效
bind-key r source-file ~/.tmux.conf \; display-message "Config Reloaded."

#拷贝模式按键重定义
set -g mode-keys vi
#定义ctrl+y进入拷贝模式
bind-key y copy-mode
#定义使用v选取
bind-key -t vi-copy v begin-selection
#定义使用y复制 加入到剪切板
bind-key -t vi-copy y copy-pipe "xclip -i -sel clip > /dev/null"
#定义ctrl+b p粘贴
bind-key p run "xclip -o -sel clip | tmux load-buffer - ; tmux paste-buffer"

# 重定义分隔窗格快捷键
unbind '"'
unbind %
bind-key | split-window -h
bind-key - split-window -v

#重定义选择分隔窗格
bind k selectp  -U
bind j selectp  -D
bind h selectp  -L
bind l selectp  -R

# 重定义新建窗口快捷键
# bind-key -n C-T new-window
#重定义窗口选择快捷键为alt + 0-9
bind-key -n M-1 select-window -t :0
bind-key -n M-2 select-window -t :1
bind-key -n M-3 select-window -t :2
bind-key -n M-4 select-window -t :3
bind-key -n M-5 select-window -t :4
bind-key -n M-6 select-window -t :5
bind-key -n M-7 select-window -t :6
bind-key -n M-8 select-window -t :7
bind-key -n M-9 select-window -t :8
bind-key -n M-0 select-window -t :9
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值