-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtmux.conf
More file actions
149 lines (111 loc) · 3.66 KB
/
tmux.conf
File metadata and controls
149 lines (111 loc) · 3.66 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#----------------------------------------------
# 前缀按键
set -g prefix C-Space
unbind C-b
bind C-Space send-prefix
# 禁用自动布局
unbind Space
#-- base --#
set -g default-shell /bin/zsh
set -g display-time 3000
set -g history-limit 65535
# 真彩色
#set-option -ga terminal-overrides ",xterm-256color:Tc"
#将bind r设置为加载配置文件,并显示"reloaded!"信息
# 配置完以后,重启tmux起效,或者在命令行模式下输入:
# source-file ~/.tmux.conf
bind r source-file ~/.tmux.conf \; display "Reloaded!"
#----------------------------------------------
#水平或垂直分割窗格
# 默认使用"上下分割和%左右分割
unbind '"'
bind - splitw -v #分割成上下两个窗格
unbind %
bind | splitw -h #分割成左右两个窗格
#----------------------------------------------
#选择分割的窗格
bind k selectp -U #选择上窗格
bind j selectp -D #选择下窗格
bind h selectp -L #选择左窗格
bind l selectp -R #选择右窗格
#----------------------------------------------
#重新调整窗格的大小
bind ^k resizep -U 10
bind ^j resizep -D 10
bind ^h resizep -L 10
bind ^l resizep -R 10
#----------------------------------------------
#交换两个窗格
bind ^u swapp -U
bind ^d swapp -D
bind ^a last
bind q killp
#----------------------------------------------
# 开启鼠标支持
set-option -g mouse on
#----------------------------------------------
#记录几条快捷键
# 切换到下一个窗口
# bind n
# 切换到上一个窗口
# bind p
# 切换到指定窗口
# bind 数字
#
# 最大化(或退出最大化)当前窗格
# bind z
set-window-option -g mode-keys vi
# Set window index to start from 1
set -g base-index 1
set -g pane-base-index 1
#----------------------------------------------
# 复制粘贴
set -g set-clipboard on
# # 定义在复制模式下,按下“v”字符开始选取待复制内容
# # bind-key -t vi-copy 'v' begin-selection
# # move x clipboard into tmux paste buffer
# bind C-p run "tmux set-buffer \"$(xclip -o -sel clipbaord)\"; tmux paste-buffer"
# # move tmux copy buffer into x clipboard
# bind C-y run "tmux show-buffer | xclip -i -sel clipbaord"
#----------------------------------------------
#特定命令绑定
bind '~' splitw htop
bind m command-prompt "splitw -h 'exec man %%'"
#----------------------------------------------
#默认启动应用
# 根据自己的需求定制启动应用
#new -s work # 新建名为 work 的会话,并启动 mutt
#neww rtorrent # 启动 rtorrent
#neww vim # 启动 vim
#neww zsh
#selectw -t 3 # 默认选择标号为 3 的窗口
# 调用脚本
# bind b source-file ~/.tmux/dev
#----------------------------------------------
#定制状态行
set -g status-left "#[fg=white,bg=blue] > #I < #[default] |" # 0:bash
set -g status-right "#[fg=yellow,bright][ #[fg=cyan]#W #[fg=yellow]]#[default] #[fg=yellow,bright]- %Y.%m.%d #[fg=green]%H:%M #[default]"
set -g status-bg black
set -g status-fg white
#setw -g window-status-current-attr bright
#setw -g window-status-current-bg red
#setw -g window-status-current-bg green
#setw -g window-status-current-fg white
#set -g status-utf8 on
set -g status-interval 1
#set -g visual-activity on
#setw -g monitor-activity on
set -g status-keys vi
setw -g mode-keys vi
#----------------------------------------------
# 会话保存
bind s save-buffer ~/.tmux-session
# 配置布局保存
# run-shell ~/.tmux/tmux-resurrect/resurrect.tmu
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# 配置会话存储插件
set -g @plugin 'tmux-plugins/tmux-resurrect'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'