summaryrefslogtreecommitdiffstats
path: root/.config/screen/screenrc
blob: 15b567362d50ada558050978343728cb0717ccec (plain)
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
#$HOME/.screenrc
#################################################################################
# Usage:
# [kent]@rd1-2:~$ screen -r     ==> resumes a detached screen session
# [kent]@rd1-2:~$ screen -x     ==> Cool, Attach to a not detached screen session. (Multi display mode)
# detach : Press F10 or "C-a d"
# HELP: "C-a, ?"
# "C-a C-a" : fast switch between 2 screens
#################################################################################

altscreen on # Refresh the display when exiting programs like vim, nano, irssi and etc.
defutf8 on
defc1 off # treat input chars 128 ~ 159 as control functions
defflow on
vbell_msg "Ding ding!!"
vbell off  # i.e. set to audible bell, used to redirect bell to terminal (putty) for "flashing effect"
defencoding utf8
# cjkwidth on

# 256 Color Support
termcapinfo xterm "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"
#for Mac
termcapinfo xterm-color "Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm"

term $TERM # depend on $TERM
term xterm-256color # or specified term

# allow bold colors - necessary for some reason
attrcolor b ".I"
attrcolor i "+b"

# erase background with current bg color
defbce on

# some environment setting
autodetach on
startup_message off
shell -$SHELL

# dynamically udpate shell title, Sometimes it's bothersome...XD
# Need to add this line PROMPT_COMMAND='echo -n -e "\033k\033\134"' to $HOME/.bashrc
# shelltitle '$ |Bash'

# setup 10,000 lines of available scrollback copy/paste
# NOTE: memory eating monster...
defscrollback 10000

# If a window goes unresponsive, don't block the whole session waiting for it.
nonblock on

# fix scrollback in putty, this is cool!
termcapinfo xterm* ti@:te@
#termcapinfo xterm|xterms|xs|rxvt ti@:te@

# turn-off log
#log off
logfile $HOME/tmp/screen-%Y%m%d-%n.log
#deflog on

# caption style
#caption always "%{.KW} %-w%{.mW}[%n] %t%{.KW}%+w"
#caption always "%{=u .G} %-w%<%{=ub .y}%n %t%{=u .G}%+w "
#caption always "%{=u kC} %= %-w%L>%{=b G}[:%n %t:]%{-}%52<%+w %L="
#caption always "%{= KW}%-w%{= ky} [%n] %t %{-}%+w %-= %{= Kk}[%l] %{= Kk}[%Y/%m/%d %c]"

# caption always "%{= KW}%-w%{= kc} [%n] %t %{-}%+w %-= %{= Kk}[%H | %l | %m/%d %c]"

# hardstatus style
# hardstatus alwaysignore
#hardstatus alwayslastline "%{= .K} [%l]%<%=%{= .W}@%H %=%{= .y} %Y/%m/%d%{= .m} %C %A"
#hardstatus alwayslastline '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]'
#hardstatus alwayslastline "%{R}[ %{w}%1` %{R}]%=%{M}%e %{G}%H %{Y} %c %{R} %d/%m/%Y %{K} Load: %l %{w}"
# hardstatus alwayslastline "%{= wk} %{by} %H %{wk} | %-Lw%{kw}◣%{= g}%n%f* %t%{wk}◤%{wk}%+Lw%< %= %{kw}◣%{= R} [%m/%d %c] %{-}"

# Ctrl + left : prev
# Ctrl + right : next
bindkey "^[O5D" prev
bindkey "^[O5C" next
bindkey "^[Od" prev
bindkey "^[Oc" next
bindkey "\033[D" prev
bindkey "\033[C" next
# putty
bindkey "^[[D" prev
bindkey "^[[C" next
# gnome-terminal
bindkey "^[[1;5D" prev
bindkey "^[[1;5C" next

# Vim HJKL-style
# Alt + H : prev
# Alt + L : next
bindkey "^[H" prev
bindkey "^[L" next

# /*Need to hack putty*/
# (Mac - iTerm) just add key mapping! Cool iTerm
# (Win - PuTTY) Resolved by AutoHotkey
#Ctrl + , : prev
#Ctrl + . : next
#bindkey "\274" prev
#bindkey "\276" next

# (Win - PuTTY) Resolved by AutoHotkey
# <s>/*Need to hack putty*/</s>
# Ctrl + Tab         : prev   (Firefox-way)
# Ctrl + Shift + Tab : next   (Firefox-way)
#bindkey "^[[27;5;9~" next
#bindkey "^[[27;6;9~" prev

# Ctrl + t : new screen       (Firefox-way), shit conflict with cscope
#bindkey "\024" screen
# Ctrl + w : close screen     (Firefox-way), shit conflict with vim - window control
#bindkey "\027" kill


# Alt + left/right, will conflict with my vimrc mapping
#bindkey "^[^[OC" next
#bindkey "^[^[OD" prev
#Alt + ,/.
#bindkey ^[, next
#bindkey ^[. prev

# C-a b : encoding big5
# C-a u : encoding utf8
bind b encoding big5 utf8
bind u encoding utf8 utf8

# C-a $num : Switch to window number 0 - 9, or to the blank window.
bindkey "^[[A" number 1

# F10 : detach
bindkey -k k; detach

# set the title for the default shell or specified program.
# screen -t gotop		1 gotop
# screen -t lf		2 lf
# screen -t emacs		3 zsh
# screen -t todo		4 zsh -c 'cd ~/Documents/_custom_apps/; zsh -i'
# screen -t shell		5 zsh

# Start at window 1
bind c screen 1
# bind 0 select 10
select 1

#backtick 1 60 60 $HOME/Tools/get_freemem
#hardstatus alwayslastline "Free: %1`"

#Hotkey for window resizing
bind = resize =
bind + resize +1
bind - resize -1
bind _ resize max

# Ctrl + ARROW_UP/ARROW_DOWN
bindkey "^[[A" resize +1
bindkey "^[[B" resize -1

# Useful bindings as Vim(hjkl)
bind j focus down
bind k focus up
bind h focus left
bind l focus right

# Integrating GNU Screen copy/scrollback mode with the local system clipboard. i.e. Copying to the Mac Clipboard
# bind y eval "writebuf" "exec sh -c 'pbcopy < /tmp/screen-exchange'"

# hardcopydir:  The directory which contains all hardcopies.
hardcopydir ~/.config/screen

msgwait 10
setenv DISPLAY ':0'

# mouse tracking allows to switch region focus by clicking
mousetrack on
# source .screen_layout
# layout save def