-
Notifications
You must be signed in to change notification settings - Fork 0
/
.screenrc
237 lines (200 loc) · 9.07 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
#
# .screenrc - GNU screen user configuration file
#
# $Id: .screenrc 190 2010-04-17 07:54:54Z yoshikaw $
#
# @see http://www.informatik.uni-hamburg.de/RZ/software/screen/screen_toc.html
# @see http://www.limy.org/program/screen_command.html
#
# Escape key is C-t, literal is a.
escape ^qQ
# I like a large scrollback buffer.
defscrollback 100000
# clear scrollback buffer
bind F eval 'scrollback 0' 'scrollback 1000' 'echo "scrollback buffer cleared"'
# don't show startup message.
startup_message off
# don't remove windows from the window list as soon as window process exits.
#zombie kr # k: destory window, r: resurrect window
# echo command name whenever a window is created or resurrected.
verbose on
# changes the name of logfile.
logfile 'screen/log/screenlog.%H.%Y%m%d-%02c:%s-%n.%t.log'
logtstamp on
logtstamp string "\n-- SCREEN [%Y/%m/%d %02c:%s] %n:%t --\n"
# changes the directory for hardcopy.
hardcopydir 'screen/hardcopy'
hardcopy_append on
# changes the filename used for reading and writing with the paste buffer.
bufferfile 'screen/screen-exchange'
# changes the kind of messages to the nethack-style.
nethack off
# enable visual vells
vbell on
# disables vbell toggle binding to use ^G as cancel.
bind ^G
# window re-numbering
# override default `N'(number) mapping
bind N colon 'number '
# shortcut of screen sub-command with title option.
bind s colon 'screen -t '
# switch window encoding
bind ^U eval 'encoding utf8' 'info'
bind ^E eval 'encoding eucjp' 'info'
# switch window encoding and changes LANG environment variable.(for b-shell)
bind u eval 'encoding utf8' '!!!echo "LANG=ja_JP.utf8; export LANG"' 'info'
bind e eval 'encoding eucjp' '!!!echo "LANG=ja_JP.eucJP; export LANG"' 'info'
# switch focus to other region(like vi)
# orverride default `k'(kill), `t'(time), `b'(break) mappings.
bind j focus down
bind k focus up
bind t focus top
bind b focus bottom
# continuous switch focus to other region(like vi)
bind ^J eval 'focus down' 'command -c cfocus'
bind ^K eval 'focus up' 'command -c cfocus'
bind -c cfocus ^J eval 'focus down' 'command -c cfocus'
bind -c cfocus ^K eval 'focus up' 'command -c cfocus'
bind -c cfocus ^T eval 'focus top' 'command -c cfocus'
bind -c cfocus ^B eval 'focus bottom' 'command -c cfocus'
# swap region to neighbour's
# orverride default `W'(width) mapping.
bind W eval 'command -c swap' 'echo "swap region to: [N]ext [P]rev"'
bind -c swap N eval 'select -' 'focus down' 'other' 'focus up' 'other' 'focus down'
bind -c swap P eval 'select -' 'focus up' 'other' 'focus down' 'other' 'focus up'
# continuous resize region
# orverride default `r'(wrap) mapping.
bind r eval 'command -c cresize'
bind -c cresize j eval 'resize +1' 'command -c cresize'
bind -c cresize k eval 'resize -1' 'command -c cresize'
bind -c cresize J eval 'resize +10' 'command -c cresize'
bind -c cresize K eval 'resize -10' 'command -c cresize'
bind -c cresize = eval 'resize =' 'command -c cresize'
bind -c cresize n eval 'resize min' 'command -c cresize'
bind -c cresize x eval 'resize max' 'command -c cresize'
# continuous switch to other window
bind ^N eval 'next' 'command -c cselect'
bind ^P eval 'prev' 'command -c cselect'
bind -c cselect ^N eval 'next' 'command -c cselect'
bind -c cselect ^P eval 'prev' 'command -c cselect'
# list of all windows is displayed in the blank window(-b) for visual window selection.
# override default `w'(windows) mapping.
bind w windowlist -b
bind ^W windowlist -b -m # sorting by most-recentry-used list.
# move cursor to begining of scrollback buffer(and move to the leftmost column of the window top)
bindkey -m ;b stuff "g/:\015\006\002"
# refuses yet another hack in rpm packaged screenrc.
# both ] and ^] does write the paste (default unnamed) buffer.
bind ^] paste .
# enable background-color-erase setting.
defbce on
# use bright colors for bold text.
attrcolor b '.I'
# the $TERM variable set to `xterm' for various environment.
term xterm
# enable 256 color
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
# don't resize terminal width when re-attached.
termcapinfo xterm 'is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;4;6l'
# changes the windowlist format to suit caption/hardstatus
windowlist title '%{u .g}Num Flags Title%=[0-9] select the number [movement] j,C-n:Down k,C-p:Up (C-)f:PageDown (C-)b:PageUp'
windowlist string '%{.g}%3n %{.y}%f%09=%{dg} %t %='
# Give me some info at the bottom of each window and the bottom of screen like scrollable tabbed bar.
# e.g.:
# +----------------------------------------------------------------------------+
# | |
# | |
# | |
# | |
# +----------------------------------------------------------------------------+
# |11 top | <--- caption (bellow each window)
# +----------------------------------------------------------------------------+
# | |
# | |
# | |
# | |
# | |
# | |
# +----------------------------------------------------------------------------+
# | 2 vim | <--- caption
# +----------------------------------------------------------------------------+
# | |
# | |
# +----------------------------------------------------------------------------+
# | 3(L) tail | <--- caption
# +----------------------------------------------------------------------------+
# |09/24 13:23:54 hostname 0 zsh 1 man 2 vim 3 tail 11 to... (load average)| <--- hardstatus
# +----------------------------------------------------------------------------+
caption always '%?%F%{= gW}%:%{= Kk}%?%2n%f%07=%t%='
# caption string description:
#
# %? - Start of a conditional statement.
# %F - Use this part of the statement if the window has focus (i.e. it
# is the only window or the currently active one).
# %{= gW} - bright white on green.
# %: - else
# %{= Kk} - bright black on black
# %? - End conditional statement.
# %2n - number of the current window with left 2 padding
# %f - flags for current window
# %07= - left 7 padding for window number and flags
# %t - title of current window
# %= - truncation/padding point
hardstatus alwayslastline '%m/%d %02c:%s %{= .g}%H%{-} %L=%-w%45L>%{=u g.}%n %t%{-}%+w %-17<%=%{= .y}(%l)'
# hardstatus string description:
#
# %m - Two-letter month number
# %d - Two-letter day number
# %02c - time (hh:mm) in 24 hour format
# %s - seconds
# %{= .g} - green color on default background
# %H - host name.
# %{-} - undo last color change(so now we're back to default color)
# %L= - left padding start here
# %-w - window list up to but not including the current window (-)
# %45L> - truncation/padding marker; place this point about 45% of the
# way into the display area (45)
# %{=u g.} - default color on green, and underline.
# %n - number of the current window.
# %t - title of current window.
# %{-} - undo last color change
# %+w - window list from the next window on (-)
# %-17< - truncation/padding point. place this point zero spaces (0)
# from the right margin (-).
# %= - truncation/paddion point.
# %{= .y} - yellow on default background.
# %l - host load average.
# APPENDIX: STRING ESCAPES (make extracts from screen (1))
#
# The attribute set can either be specified as hexadecimal number
# or a combination of the following letters:
#
# d dim
# u underline
# b bold
# r reverse
# s standout
# B blinking
#
# Colors are coded either as a hexadecimal number or two letters specifying
# the desired background and foreground color (in that order).
# The following colors are known:
#
# k black
# r red
# g green
# y yellow
# b blue
# m magenta
# c cyan
# w white
# d default color
# . leave color unchanged
#
# The capitalized versions of the letter specify bright colors.
# You can also use the pseudo-color `i' to set just the brightness and leave the color unchanged.
# Ignore case when searching.
ignorecase on
# include hostlocal .screenrc
source '.screenrc.local'
altscreen on