Skip to content

Commit 2cff496

Browse files
committedAug 24, 2011
Initial commit - import version 20110824
0 parents  commit 2cff496

File tree

4 files changed

+150
-0
lines changed

4 files changed

+150
-0
lines changed
 

‎bash_include

+80
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
colorprompting='\[\e[1;31m\]\!\[\e[m\] [\[\e[1;33m\]\u\[\e[m\]@\[\e[1;32m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]]\$ '
2+
nocolorprompting='\! [\u@\h \w]\$ '
3+
4+
HISTSIZE=100000
5+
HISTFILESIZE=100000
6+
7+
alias startcolor='PS1=$colorprompting'
8+
alias stopcolor='PS1=$nocolorprompting'
9+
10+
alias ll='ls -l'
11+
alias rm='rm -i'
12+
alias cp='cp -i'
13+
alias mv='mv -i'
14+
alias jobs='jobs -l'
15+
alias less='less -RS'
16+
17+
alias cccc='LANG=C;LC_ALL=C'
18+
alias enus='LANG=en_US.UTF-8;LC_ALL=en_US.UTF-8'
19+
alias big5='LANG=zh_TW.Big5;LC_ALL=zh_TW.Big5'
20+
alias zhtw='LANG=zh_TW.UTF-8;LC_ALL=zh_TW.UTF-8'
21+
alias utf8='LANG=zh_TW.UTF-8;LC_ALL=zh_TW.UTF-8'
22+
23+
default_tty_setting=`stty -g`
24+
alias savetty='default_tty_setting=`stty -g`'
25+
alias resetty='stty $default_tty_setting'
26+
27+
# Function
28+
29+
function compile_all ()
30+
{
31+
noask=0
32+
[ "$1" == '' ] && echo "Which file(s) do you want to compile? " && return 1
33+
[ "$1" == "-n" ] && noask=1
34+
if [ "$noask" == "0" ]; then
35+
read -p "CFLAGS [$CFLAGS] ? " NEWCFLAGS
36+
read -p "LDFLAGS [$LDFLAGS] ? " NEWLDFLAGS
37+
[ "$NEWCFLAGS" '!=' '' ] && CFLAGS=$NEWCFLAGS
38+
[ "$NEWLDFLAGS" '!=' '' ] && LDFLAGS=$NEWLDFLAGS
39+
else
40+
shift
41+
fi
42+
while [ "$1" '!=' '' ]
43+
do
44+
TARGETFILE="`echo "$1" | cut -d . -f 1`"
45+
SUFFIX="`echo "$1" | cut -d . -f 2`"
46+
if [ -f "$1" ]; then
47+
true
48+
else
49+
printf\
50+
'\e[1;33mWarning\e[0m: Non-existent file or not a regular file\n'
51+
shift ; continue
52+
fi
53+
[ "$TARGETFILE" == "$1" ] && shift && continue
54+
if [ "$SUFFIX" == "c" ]; then
55+
echo "[CC] $1 -> $TARGETFILE"
56+
gcc $CFLAGS "$1" $LDFLAGS -o "$TARGETFILE"
57+
elif [ "$SUFFIX" == "cpp" ]; then
58+
echo "[CXX] $1 -> $TARGETFILE"
59+
g++ $CFLAGS "$1" $LDFLAGS -o "$TARGETFILE"
60+
else
61+
printf 'Unknown suffix (\e[1;33mskipped\e[0m)\n'
62+
fi
63+
[ "$?" '!=' "0" ] && printf\
64+
'\e[1;31mError\e[0m while compiling file\n'
65+
shift
66+
done
67+
return 0
68+
}
69+
70+
71+
# Starting doing something
72+
73+
startcolor
74+
75+
umask 0022
76+
77+
bind '"\e[A":history-search-backward'
78+
bind '"\e[B":history-search-forward'
79+
80+
shopt -s histappend

‎screenrc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
caption always "%{= kc}%-Lw%{= br}%n %t%{= kc}%+Lw %=%{= g}%l"
2+
3+
vbell off
4+
vbellwait 0
5+
defscrollback 65536
6+
7+
hardcopydir /home/lantw44/hardcopy
8+
9+
deflogin on
10+
shell -bash
11+
screen
12+
title bash
13+
deflogin off
14+
15+
zombie ^C^R

‎ssh_config

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ForwardX11 yes
2+
ForwardX11Trusted yes

‎vimrc

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
let $ERRFILE="/tmp/f8fe1f28-6e6e-11e0-b22e-000c760ae4c6.err"
2+
let $CFLAGS="-Wall -O2 -pipe"
3+
let $LDFLAGS=""
4+
set bs=2
5+
set ls=2
6+
set ts=4
7+
set sw=4
8+
set cindent
9+
set hls
10+
set ru
11+
set nocp
12+
syntax on
13+
set background=light
14+
highlight Comment ctermfg=darkcyan
15+
highlight Search term=reverse ctermbg=4 ctermfg=7
16+
17+
function! SingleCompile()
18+
let file_suffix = expand("%:e")
19+
if file_suffix == "c"
20+
!gcc ${CFLAGS} %:p:. -o %:r ${LDFLAGS} 2>&1 | tee ${ERRFILE}
21+
cg ${ERRFILE}
22+
elseif file_suffix == "cpp"
23+
!g++ ${CFLAGS} %:p:. -o %:r ${LDFLAGS} 2>&1 | tee ${ERRFILE}
24+
cg ${ERRFILE}
25+
else
26+
echo "This file has an UNKNOWN SUFFIX!"
27+
endif
28+
endfunction
29+
30+
map <F1> :echo "CFLAGS="$CFLAGS"\n"<CR>:let $CFLAGS="-Wall -O2 -pipe
31+
map <F2> :cl<CR>
32+
map <F3> :cp<CR>
33+
map <F4> :cn<CR>
34+
map <F5> :tabp<CR>
35+
map <F6> :tabn<CR>
36+
map <F7> :set background=light<CR>:highlight Comment ctermfg=darkcyan<CR>
37+
map <F8> :set background=dark<CR>:highlight PreProc ctermfg=darkcyan<CR>
38+
map <F9> :call SingleCompile()<CR>
39+
map <F10> :make<CR>
40+
map <F11> :echo "LDFLAGS="$LDFLAGS"\n"<CR>:let $LDFLAGS="
41+
map <F12> :!less -R %:p:.<CR>
42+
imap <F1> <ESC><F1>
43+
imap <F2> <ESC><F2>a
44+
imap <F3> <ESC><F3>a
45+
imap <F4> <ESC><F4>a
46+
imap <F5> <ESC><F5>a
47+
imap <F6> <ESC><F6>a
48+
imap <F7> <ESC><F7>a
49+
imap <F8> <ESC><F8>a
50+
imap <F9> <ESC><F9>
51+
imap <F10> <ESC><F10>
52+
imap <F11> <ESC><F11>
53+
imap <F12> <ESC><F12>

0 commit comments

Comments
 (0)
Please sign in to comment.