-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmux.conf
75 lines (63 loc) · 2.05 KB
/
.tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# C-q 前缀键
#set -g prefix C-q
#unbind C-b
#bind C-q send-prefix
set-option -g repeat-time 400
set-option -g set-titles on
set-option -g set-titles-string "[#S] #I:#W#F"
# r:重载配置
bind r source-file ~/.tmux.conf \; display-message "Config reloaded.."
# |\:横向分屏 -:纵向分屏
unbind '"'
bind - splitw -v -c '#{pane_current_path}'
unbind %
bind '\' splitw -h -c '#{pane_current_path}'
bind | splitw -h -c '#{pane_current_path}'
# 鼠标支持
setw -g mouse on
# 绑定hjkl键为面板切换的上下左右键
bind -n M-k select-pane -U # 绑定k为↑
bind -n M-j select-pane -D # 绑定j为↓
bind -n M-h select-pane -L # 绑定h为←
bind -n M-l select-pane -R # 绑定l为→
bind k select-pane -U # 绑定k为↑
bind j select-pane -D # 绑定j为↓
bind h select-pane -L # 绑定h为←
bind l select-pane -R # 绑定l为→
bind -n M-n next-window
bind -n M-p previous-window
# kill-pane 无需确认
bind x kill-pane
#bind q set -g status
# 开启vi风格后,支持vi的C-d、C-u、hjkl等快捷键
setw -g mode-keys vi
# 绑定v键为开始选择文本
bind -T copy-mode-vi v send-keys -X begin-selection
# 绑定y键为复制选中文本到系统剪贴板,需要安装xclip
bind -T copy-mode-vi y send -X copy-pipe-and-cancel "xclip -selection c"
# escape延迟卡顿 1ms
set -s escape-time 1
# 窗格从1开始计数,方便按
# setw -> set-window-option
set -g base-index 1
setw -g pane-base-index 1
# 24位真彩色
set -g default-terminal "xterm-256color"
set -ga terminal-overrides ",*256col*:Tc"
set -ga terminal-overrides '*:Ss=\E[%p1%d q:Se=\E[ q'
# 状态栏
# 颜色
set -g status-bg '#1e1e1e'
set -g status-fg '#e8e8e3'
# 对齐方式
#set-option -g status-justify centre
# 左下角
set-option -g status-left '#[fg=#a6e22d][#S] '
set-option -g status-left-length 20
# 窗口列表
setw -g automatic-rename off
setw -g allow-rename off
set-window-option -g window-status-format '#[fg=#575b61]#I:#W '
set-window-option -g window-status-current-format '#[fg=#e6db74,bold]#I:#W#F'
# 右下角
set -g status-right '#[fg=#a6e22d][%Y-%m-%d %H:%M:%S]'