forked from vuleetu/home
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.screenrc
247 lines (179 loc) · 8.13 KB
/
.screenrc
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
# vim:set et ft=screen fdm=marker sw=4 sts=4 ts=4 nopaste :
# [ Style ]# {{{
#--------------------------------------------
# 关闭启动画面 default: on
startup_message off
# 当 terminal 关闭时,screen 自动挂起 default: on
autodetach on
# 不使用 响铃 beep 提示,而使用 闪屏
vbell off
#vbell_msg " Wuff ---- Wuff!! "
# 退出相关程序(vim,htop...),自动刷新屏幕
altscreen on
# 刷新全部窗口
#allpartial on
# 和 redisplay 一同刷新窗口,仅刷新当前激活窗口,默认:on
#partial on
#redisplay
# }}}
# [ base ]# {{{
#--------------------------------------------
# 指定 shell
#shell bash
#shell /bin/zsh
# 默认开始路径
# chdir
# 历史回滚行数
defscrollback 10000
# 指定编码
defencoding utf-8
encoding utf-8 utf-8
# Utf-8 handling
#defutf8 on
# }}}
# [ key 快捷键 ]# {{{
#--------------------------------------------
# 默认前缀快捷键 C-a
# 尝试过:C-b( vim 滚屏 ),C-x(无法切换上次聚焦窗口),\\ `` 不方便
escape ^ll
#escape \\
#escape ``
# F1 to select 1
#bindkey -k k1 select 1
# F7 to detach screen session
#bindkey -k k7 detach
# F8 to kill current screen window
#bindkey -k k8 kill
# F9 to create a new screen
bindkey -k k9 screen
# F10 to rename current screen window
#bindkey -k k; title
# F11/F12 to "move to previous window"
bindkey -k F1 prev
bindkey -k F2 next
# }}}
# 底部标题栏 caption / hardstatus(最底部)
# 转义字符:man 手册里面的 STRING ESCAPES
# [ Color VARIABLES - Strings ]# {{{
#--------------------------------------------
# From : https://github.com/px/screenrc/blob/master/.screenrc
# COLOR: colors codes are combinations of
# [attribute modifier] [color description]
# the manual talks of "attribute/color modifiers".
# man 手册 "STRING ESCAPES".
# k black
# r red
# g green
# y yellow
# b blue
# m magenta 洋红
# c cyan 亮蓝
# w white
# d default color
# . leave color unchanged
# %h king@king:~
# %l loadavg 负载
# }}}
# 大括号里面为颜色组合
# [ caption 状态栏 ]# {{{
#--------------------------------------------
# XXX [?] 状态栏, 不用 Hardstatus 实现, 因为要把 xterm 的 title 伪装成 Hardstatus
# 当前聚焦窗口不使用背景色是因为:背景色只能作用于文字部分,空白间距不能渲染,看起来不舒服
# 相反 tmux 背景色可以应用于空白间隔,可以使用中括号,等标记标志
# 背景颜色与终端相同,无高亮,全部用颜色标注,都为粗体
# [king] 0 bash *1 bash 06-26 11:06
#caption always "%{=b}%{b}%{G}[%H]%{-} %+07=%-w%7L>%{b .y}*%n %t%{-}%+w%-014< %-012=%{b m}%m/%d %c "
# 全局粗体,蓝色字体,绿色用户名,取消之前属性,窗口列表举例7像素,当前聚焦窗口为黄色,最后的窗口举例时间14像素
# [king] 0 irssi 1 vim 2 vim 05/21 10:21
#caption always "%{=b k}%{c}[%H] %{-} %+07=%-w%7L>%{g}%n %t%{-}%+w%-014< %-012=%{b y}%m/%d %c "
# %+07=%-w%7L
# XXX 窗口列表从第 7 个字符处开始,会覆盖前面的超过 7 个字符的信息
# [ king ] 0 /tmp 1 /boot 05/21 16:23
#caption always "%{=b k}%{c}[ %H ] %{-} %L=%-w%7L>%{g}%n %t%{-}%+w%-014< %-012=%{b y}%m/%d %c "
# 0.05 0.05 0.05 | 0 ~ 1 /tmp [ 2 top ] 05/21 16:10
#caption always "%{=b k}%{c} %l | %{k}%L=%-w%7>%{g}[ %n %t ]%{-}%+w%-014< %-012=%{b y}%m/%d %c "
#caption always "%{=b k}%{c} %l | %{k}%L=%-w%7>%{g}%n %t%{-}%+w%-014< %-012=%{b y}%m/%d %c "
# 06-20 11:59 | 0 su 1 irssi 2 vim 5 ~ 0.10 0.04 0.00
caption always "%{=b k}%{b y} %m-%d %c / %{k}%L=%-w%7>%{g}%n %t%{-}%+w%-014< %-016=%{c} %l "
# 当前焦点 窗口 背景色高亮
#caption always "%{=b k}%{b y} %m-%d %c | %{k}%L=%-w%7>%{= gk}%n %t%{-}%+w%-014< %-016=%{c} %l "
# 时间 / 当前焦点 窗口 / loadavage 背景色高亮
#caption always "%{=b k} %{= yk} %m-%d %c %{-} %{k}%L=%-w%7>%{= gk}%n %t%{-}%+w%-014< %-016=%{= ck} %l "
# 背景绿色,前景 加粗 浅灰
#caption always "%{=b k}%{b y} %m-%d %c / %{k}%L=%-w%7>%{gk}%n %t%{-}%+w%-014< %-016=%{c} %l "
# 背景绿色,前景 正常 黑色
#caption always "%{=b k}%{b y} %m-%d %c / %{k}%L=%-w%7>%{= gk}%n %t%{-}%+w%-014< %-016=%{c} %l "
# 背景色 当前高亮色 时间 当前窗口无任何修饰符
#caption always "%{= kw}%-w%{= bY}%n %t%{-}%+w %-= %c"
# %{k}%L=%-w%7
# 背景色黑色 左对齐 窗口标题 7像素宽
# >%{g}%n %t%{-}%+w%-014<
# 聚焦的窗口标题背景色 绿色 样式:编号 名称 最大宽度 14 字符宽度
# 0.00 0.01 0.05 | 0 vim 1 top 2 /tmp 05/21 16:07
#caption always "%{=b k}%?%F%{c}%:%? %l | %?%F%{k}%?%L=%-w%45>%{g}%n %t%{-}%+w%-014< %-012=%{b y}%m/%d %c "
# king | 0.01 0.00 0.00 | 06-25 12:25 |0$* bash
#caption always "%?%F%{-b 4w}%:%{-b bb}%? %H | %l | %m-%d %c |%?%F%{-b 4w}%?%L=%-Lw%45>%{-b w4}%n%f* %t%{-}%+Lw%-0<"
# 单一窗口 无窗口列表,最后为窗口编号
# 10:37AM Sat 26-06-2010 bash 0
#caption always "%?%F%{= Bk}%? %C%A %D %d-%m-%Y %{= kB} %t%= %?%F%{= Bk}%:%{= wk}%? %n "
# king|12:33|25Jun|0*$bash 多背景色 窗口标题 有先后 * - 标志
#hardstatus alwayslastline "%{rw}%H%{wk}|%{wr}%c%{wk}|%d%M|%?%-Lw%?%{wb}%n*%f%t%?(%u)%?%{wk}%?%+Lw%?"
#caption always "%{= kw}%-w%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+w %=%d %M %0c %{g}%H%{-}"
#------------------- compilex ----------------------
# [ king ][ 0$ bash (1*$bash) 2-$ bash ][ 25/06 12:32 ]
#hardstatus alwayslastline '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
# [king] *0 bash 06-25 12:26
#hardstatus alwayslastline "%{=b}%{b}%{C}[%H]%{-} %+010=%-w%8L>%{uB .my}*%n %t%{-}%+w%-014< %-012=%{b m}%m-%d %c "
#caption always "%{= R}[ %{=b b}%-w%{=rb db}%>%n %t%{-}%+w%{-b}%< %=%{R}][%{M}%D %M %d %{G}%c%{R}]"
#------------------- simple ----------------------
# Screen(s): 0 bash 1* bash 12:28PM Fri, Jun/25/2010
# hardstatus alwayslastline "%{=b}%{G} Screen(s): %{b}%w %=%{kG}%C%A %D, %M/%d/%Y "
# 窗口标题 序号,没有其他修饰符了
#caption always "%{.kW}%-w%{.KY}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
# 背景色 当前高亮色 时间 当前窗口无任何修饰符
#caption always "%{= kw}%-w%{= bY}%n %t%{-}%+w %-= %c"
# }}}
# [ XXX ] #--------------------------------------------
# 定制 region 函数键与Emacs一致
#bind 0 remove
#bind 1 only
#bind 2 split
#bind o focus
# 使 screen 在 xterm 里面可以使用滚动条和滚轮 scrollbar
#termcapinfo xterm ti@:te@
#terminfo xterm*|rxvt ti@:te@
# [ title ]
#--------------------------------------------
# 将所运行程序的名称作为screen的title的功能, 默认bash
# "$" ==> 命令的第一个字符段
shelltitle '$ |bash'
#shelltitle '] |bash'
#shelltitle '% |zsh'
# screen中动态设置标题
# http://www.adam8157.info/blog/2011/04/screen-dynamic-titles/
hardstatus off
# %H hostname 当在远程启动 screen 时才变得有效
hardstatus string "Screen@%H: %t"
## 把 xterm 的 titlebar 当作 screen 的hardstatus
termcapinfo xterm* 'hs:ts=\E]0;:fs=\007:ds=\E]0;\007'
# [ termcapinfo ]
#--------------------------------------------
## 定制 title bar
#termcapinfo rxvt 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
#termcapinfo xterm 'hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
##terminfo xterm* 'XT:hs:ts=\E]2;:fs=\007:ds=\E]2;screen\007'
# screen 如何设置颜色:AB = 背景色,AF = 前景色
##terminfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# 修复 rxvt-unicode 256 色 问题
#terminfo rxvt-unicode 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# 为特定的命令指定 title
#screen -t mutt mutt
#screen -t irssi irssi
## Set messages timeout to 5 second:
#msgwait 5
#msgminwait 2
#pow_detach_msg "Screen session of \$LOGNAME \$:cr:\$:nl:ended."
#nethack style messages
#nethack on
# Disable login
#deflogin off