aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLAN-TW <lantw44@gmail.com>2011-08-24 08:54:29 +0800
committerLAN-TW <lantw44@gmail.com>2011-08-24 08:54:29 +0800
commit2cff496181a2c38bf2b739c36b8153712cd65800 (patch)
treeb4939c8d26c7a6ecee25662b02abf45b57b86e6c
downloadconfigfile-2cff496181a2c38bf2b739c36b8153712cd65800.tar
configfile-2cff496181a2c38bf2b739c36b8153712cd65800.tar.gz
configfile-2cff496181a2c38bf2b739c36b8153712cd65800.tar.bz2
configfile-2cff496181a2c38bf2b739c36b8153712cd65800.tar.lz
configfile-2cff496181a2c38bf2b739c36b8153712cd65800.tar.xz
configfile-2cff496181a2c38bf2b739c36b8153712cd65800.tar.zst
configfile-2cff496181a2c38bf2b739c36b8153712cd65800.zip
-rw-r--r--bash_include80
-rw-r--r--screenrc15
-rw-r--r--ssh_config2
-rw-r--r--vimrc53
4 files changed, 150 insertions, 0 deletions
diff --git a/bash_include b/bash_include
new file mode 100644
index 0000000..6ab16fa
--- /dev/null
+++ b/bash_include
@@ -0,0 +1,80 @@
+colorprompting='\[\e[1;31m\]\!\[\e[m\] [\[\e[1;33m\]\u\[\e[m\]@\[\e[1;32m\]\h\[\e[m\] \[\e[1;36m\]\w\[\e[m\]]\$ '
+nocolorprompting='\! [\u@\h \w]\$ '
+
+HISTSIZE=100000
+HISTFILESIZE=100000
+
+alias startcolor='PS1=$colorprompting'
+alias stopcolor='PS1=$nocolorprompting'
+
+alias ll='ls -l'
+alias rm='rm -i'
+alias cp='cp -i'
+alias mv='mv -i'
+alias jobs='jobs -l'
+alias less='less -RS'
+
+alias cccc='LANG=C;LC_ALL=C'
+alias enus='LANG=en_US.UTF-8;LC_ALL=en_US.UTF-8'
+alias big5='LANG=zh_TW.Big5;LC_ALL=zh_TW.Big5'
+alias zhtw='LANG=zh_TW.UTF-8;LC_ALL=zh_TW.UTF-8'
+alias utf8='LANG=zh_TW.UTF-8;LC_ALL=zh_TW.UTF-8'
+
+default_tty_setting=`stty -g`
+alias savetty='default_tty_setting=`stty -g`'
+alias resetty='stty $default_tty_setting'
+
+# Function
+
+function compile_all ()
+{
+ noask=0
+ [ "$1" == '' ] && echo "Which file(s) do you want to compile? " && return 1
+ [ "$1" == "-n" ] && noask=1
+ if [ "$noask" == "0" ]; then
+ read -p "CFLAGS [$CFLAGS] ? " NEWCFLAGS
+ read -p "LDFLAGS [$LDFLAGS] ? " NEWLDFLAGS
+ [ "$NEWCFLAGS" '!=' '' ] && CFLAGS=$NEWCFLAGS
+ [ "$NEWLDFLAGS" '!=' '' ] && LDFLAGS=$NEWLDFLAGS
+ else
+ shift
+ fi
+ while [ "$1" '!=' '' ]
+ do
+ TARGETFILE="`echo "$1" | cut -d . -f 1`"
+ SUFFIX="`echo "$1" | cut -d . -f 2`"
+ if [ -f "$1" ]; then
+ true
+ else
+ printf\
+ '\e[1;33mWarning\e[0m: Non-existent file or not a regular file\n'
+ shift ; continue
+ fi
+ [ "$TARGETFILE" == "$1" ] && shift && continue
+ if [ "$SUFFIX" == "c" ]; then
+ echo "[CC] $1 -> $TARGETFILE"
+ gcc $CFLAGS "$1" $LDFLAGS -o "$TARGETFILE"
+ elif [ "$SUFFIX" == "cpp" ]; then
+ echo "[CXX] $1 -> $TARGETFILE"
+ g++ $CFLAGS "$1" $LDFLAGS -o "$TARGETFILE"
+ else
+ printf 'Unknown suffix (\e[1;33mskipped\e[0m)\n'
+ fi
+ [ "$?" '!=' "0" ] && printf\
+ '\e[1;31mError\e[0m while compiling file\n'
+ shift
+ done
+ return 0
+}
+
+
+# Starting doing something
+
+startcolor
+
+umask 0022
+
+bind '"\e[A":history-search-backward'
+bind '"\e[B":history-search-forward'
+
+shopt -s histappend
diff --git a/screenrc b/screenrc
new file mode 100644
index 0000000..bc87e21
--- /dev/null
+++ b/screenrc
@@ -0,0 +1,15 @@
+caption always "%{= kc}%-Lw%{= br}%n %t%{= kc}%+Lw %=%{= g}%l"
+
+vbell off
+vbellwait 0
+defscrollback 65536
+
+hardcopydir /home/lantw44/hardcopy
+
+deflogin on
+shell -bash
+screen
+title bash
+deflogin off
+
+zombie ^C^R
diff --git a/ssh_config b/ssh_config
new file mode 100644
index 0000000..f8eafc3
--- /dev/null
+++ b/ssh_config
@@ -0,0 +1,2 @@
+ForwardX11 yes
+ForwardX11Trusted yes
diff --git a/vimrc b/vimrc
new file mode 100644
index 0000000..3c27b7b
--- /dev/null
+++ b/vimrc
@@ -0,0 +1,53 @@
+let $ERRFILE="/tmp/f8fe1f28-6e6e-11e0-b22e-000c760ae4c6.err"
+let $CFLAGS="-Wall -O2 -pipe"
+let $LDFLAGS=""
+set bs=2
+set ls=2
+set ts=4
+set sw=4
+set cindent
+set hls
+set ru
+set nocp
+syntax on
+set background=light
+highlight Comment ctermfg=darkcyan
+highlight Search term=reverse ctermbg=4 ctermfg=7
+
+function! SingleCompile()
+ let file_suffix = expand("%:e")
+ if file_suffix == "c"
+ !gcc ${CFLAGS} %:p:. -o %:r ${LDFLAGS} 2>&1 | tee ${ERRFILE}
+ cg ${ERRFILE}
+ elseif file_suffix == "cpp"
+ !g++ ${CFLAGS} %:p:. -o %:r ${LDFLAGS} 2>&1 | tee ${ERRFILE}
+ cg ${ERRFILE}
+ else
+ echo "This file has an UNKNOWN SUFFIX!"
+ endif
+endfunction
+
+map <F1> :echo "CFLAGS="$CFLAGS"\n"<CR>:let $CFLAGS="-Wall -O2 -pipe
+map <F2> :cl<CR>
+map <F3> :cp<CR>
+map <F4> :cn<CR>
+map <F5> :tabp<CR>
+map <F6> :tabn<CR>
+map <F7> :set background=light<CR>:highlight Comment ctermfg=darkcyan<CR>
+map <F8> :set background=dark<CR>:highlight PreProc ctermfg=darkcyan<CR>
+map <F9> :call SingleCompile()<CR>
+map <F10> :make<CR>
+map <F11> :echo "LDFLAGS="$LDFLAGS"\n"<CR>:let $LDFLAGS="
+map <F12> :!less -R %:p:.<CR>
+imap <F1> <ESC><F1>
+imap <F2> <ESC><F2>a
+imap <F3> <ESC><F3>a
+imap <F4> <ESC><F4>a
+imap <F5> <ESC><F5>a
+imap <F6> <ESC><F6>a
+imap <F7> <ESC><F7>a
+imap <F8> <ESC><F8>a
+imap <F9> <ESC><F9>
+imap <F10> <ESC><F10>
+imap <F11> <ESC><F11>
+imap <F12> <ESC><F12>