-
Notifications
You must be signed in to change notification settings - Fork 2
/
.screenrc
169 lines (153 loc) · 6.47 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
# GNU Screen configuration file
# Sibi <[email protected]>
#
# Notes
# -----
# 1. Modified to work with Emacs: C-t is the action command, not C-a.
# 2. To change the colors of the hardstatus line, change this line:
# sorendition "+b +kG"
# Example: blue (+b) highlight with black text (k) on a green background (G)
# Example: sorendition "+r +kG" is red highlighting with black text on a green background
# 3. Install xsel (So that you can copy stuff to clipboard using C-t b)
#
# Modification of original files by Sven Guckes, Sarunas Vancevicius, and Mike Perry
# Sarunas Vancevicius original: http://www.redbrick.dcu.ie/~svan/configs/screenrc
# Mike Perry original: http://fscked.org/writings/225notes/unix/.screenrc
## -----------------------------------------------------------------------------------------
## -- 1) Set variables and keybindings for emacs compatibility (remapping Ctrl-A to Ctrl-T)
## -----------------------------------------------------------------------------------------
markkeys "h=^B:l=^F:$=^E" # emacs style keybindings during copy mode movement in screen
autodetach on # default: on
crlf off # default: off
#deflogin off # default: on
hardcopy_append on # default: off
startup_message off # default: on
vbell off # default: ???
escape "^Tt" # ctrl-A default interferes with emacs keybindings for terminal
defutf8 on # unicode by default
defscrollback 10000 # default: 100
silencewait 15 # default: 30
activity "activity in %n (%t) [%w:%s]~"
bell "bell in %n (%t) [%w:%s]~"
shell "fish"
# Change keybindings for convenience
bind ^Q mapdefault
bind q mapdefault
bind k
bind ^k
bind .
bind ^\
bind \\
bind ^h
bind h
bind ''
bind 'L'
#bind 'I' login on
#bind 'O' login off
bind '}' history
bind ^a
# aterm bindings
bindkey "Oc" next
bindkey "Od" prev
# Emacs compatibility
# Easy switching of windows without p/n confusion, as ctrl-p and ctrl-n
# are frequently used in emacs but u/j are not...
bind 'u' prev
bind ^U prev
bind 'j' next
bind ^J next
# Emacs compatibility for screen movement (if you use subscreen regions)
# Using tab to move around regions gets annoying. These help.
bind ^P focus up
bind 'p' focus up
bind ^N focus down
bind 'n' focus down
bind ^F focus top
bind 'f' focus top
bind ^B focus bottom
bind 'b' focus bottom
## -------------------------------------------------------------------------------------------------
## -- 2) Hardstatus line (aka navigation bar at bottom)
## and sorendition (aka color scheme for navigation bar)
## -------------------------------------------------------------------------------------------------
# 2.1) sorendition = color scheme
# Set the colors for the "messages" and "text marking"
# Example: "+b kG" = blue screen, black text, green background. Change
# to "+b kR" and so on to distinguish machines.
sorendition "+b kG"
# 2.2) hardstatus = navigation bar @ bottom
# https://superuser.com/a/598128/177053
# backtick 1 1200 1200 sibi-uptime
# backtick 2 0 0 sibi-distro
# backtick 3 10800 10800 sibi-disk
hardstatus alwayslastline "%{-b kw}%u %-Lw%{= rW}%50> %n%f %t %{-}%+Lw%<"
# 2.3) Autoload two screen tabs for emacs/bash.
screen -t ghci 0
screen -t bash 1
screen -t yesod 2
screen -t db 3
screen -t dev 4
screen -t d1 5
screen -t d2 6
screen -t d3 7
select 1
select 2
select 3
select 4
select 5
select 6
select 7
select 0
# Split it
# split -v
# focus
# 2.4) Description of the keywords used in hardstatus
# caption always "%?%F%{-b bc}%:%{-b bb}%?%C|%D|%M %d|%H%?%F%{+u wb}%? %L=%-Lw%45>%{+b by}%n%f* %t%{-}%+Lw%-0<"
#
# Anything I don't describe is treated literally.
#
# %? - 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).
# %{-b bc} - Turn off bold, blue foreground, cyan background.
# %: - else
# %{-b bb} - Turn off bold, blue foreground, blue background (this obscures
# the text on non-focused windows and just gives a blue line).
# %? - End conditional statement.
# %C - time (hh:mm, leading space) in 12 hour format
# %D - Three-letter day-of-week appreviation
# %M - Three-letter month appreviation
# %d - Day of the month
# %H - hostname
# %? - Start of conditional statement.
# %F - Use this part of the statement if the window has focus.
# %{+u wb} - underlined, white foreground, blue background
# %? - End conditional (if not focused, text remaind blue on blue).
# %L= - truncation/padding point. With the 'L' qualifier, basically
# just acts as a reference point. Further truncation/padding is
# done relative to here, not the beginning of the string
# %-Lw - window list up to but not including the current window (-),
# show window flags (L)
# %45> - truncation/padding marker; place this point about 45% of the
# way into the display area (45)
# %{+b by} - add bold (still underlined from before), blue foreground,
# yellow background
# %n - number of the current window
# %f - flags for current window
# %t - title of current window
# %{-} - undo last color change (so now we're back to underlined white
# on blue) (technically, this is a pop; a second invocation
# would drop things back to unadorned blue on cyan)
# %+Lw - window list from the next window on (-), show window flags (L)
# %-0< - truncation/padding point. Place this point zero spaces (0)
# from the right margin (-).
# This binds C-t b to copy screen's copy buffer to the system clipboard.
# Adapted from here with change in the command key (ofcourse!):
# http://www.commandlinefu.com/commands/view/2276/getting-screens-copy-buffer-into-xs-copy-buffer-on-linux
bind b eval writebuf 'exec /bin/sh -c "wl-copy < /tmp/screen-exchange"' 'exec /bin/sh -c "killall wl-copy"'
# Keybindings refresher
# Split it vertical : C-t |
# Go to the new splitted tab : C-t TAB
# Quit the new tab : C-t Q
# For MacOS: https://stackoverflow.com/a/41070816/1651941
# bindkey -m ' ' eval 'stuff \040' 'writebuf' 'exec sh -c "/usr/bin/pbcopy < /tmp/screen-exchange"'