eval $(dircolors -b ~/.dircolors) shopt -s cdspell shopt -s extglob shopt -s cmdhist shopt -s checkwinsize shopt -s no_empty_cmd_completion shopt -u promptvars set -o noclobber #kill flow control if tty -s ; then stty -ixon stty -ixoff fi #set -o functrace if [ "$TERM" = "linux" ]; then echo -en "\e]P0222222" #black echo -en "\e]P8222222" #darkgrey echo -en "\e]P1803232" #darkred echo -en "\e]P9982b2b" #red echo -en "\e]P25b762f" #darkgreen echo -en "\e]PA89b83f" #green echo -en "\e]P3aa9943" #brown echo -en "\e]PBefef60" #yellow echo -en "\e]P4324c80" #darkblue echo -en "\e]PC2b4f98" #blue echo -en "\e]P5706c9a" #darkmagenta echo -en "\e]PD826ab1" #magenta echo -en "\e]P692b19e" #darkcyan echo -en "\e]PEa1cdcd" #cyan echo -en "\e]P7ffffff" #lightgrey echo -en "\e]PFdedede" #white #this is an attempt at working utf8 line drawing chars in the linux-console # export TERM=linux+utf8 clear #hmm, yeah we need this or else we get funky background collisions fi alias ls="ls --color=auto -hF" alias ll="ls -l" alias la="ls -a" alias vi="vim" alias grep="grep -n --color=auto" alias pg="pg -n -p 'page %d:'" alias mp="mplayer" alias screenrd="screen -Rd" alias srvscreen="screen -R -c ~/.screenrc.server" #make OOo not look like ass export OOO_FORCE_DESKTOP=gnome # for scim, if I want to try and type nihongo #export GTK_IM_MODULE="scim" #export QT_IM_MODULE="scim" export PATH=$PATH:~/bin export CVS_RSH=ssh export HISTIGNORE="&:[bf]g:exit" export HISTCONTROL=ignoredups export HISTFILESIZE=10000 export HISTSIZE=10000 export INPUTRC=/etc/inputrc export EDITOR=vim export VISUAL=vim export BROWSER=firefox export PAGER=less export MANPAGER=less export MAILCHECK=0 export MAIL=~/.mail export IGNOREEOF=3 #LESS man page colors export LESS_TERMCAP_mb=$'\E[01;31m' export LESS_TERMCAP_md=$'\E[01;31m' export LESS_TERMCAP_me=$'\E[0m' export LESS_TERMCAP_se=$'\E[0m' export LESS_TERMCAP_so=$'\E[01;44;33m' export LESS_TERMCAP_ue=$'\E[0m' export LESS_TERMCAP_us=$'\E[01;32m' function mkcd() { mkdir "$1" && cd "$1"; } function calc() { echo "$*" | bc; } function hex2dec { awk 'BEGIN { printf "%d\n",0x$1}'; } function dec2hex { awk 'BEGIN { printf "%x\n",$1}'; } function mktar() { tar czf "${1%%/}.tar.gz" "${1%%/}/"; } function mkmine() { sudo chown -R ${USER} ${1:-.}; } function rot13 () { echo "$@" | tr a-zA-Z n-za-mN-ZA-M; } function :h () { vim --cmd ":silent help $@" --cmd "only"; } function sendkey () { if [ $# -ne 1 ]; then ssh $1 'cat >> ~/.ssh/authorized_keys' < ~/.ssh/id_dsa.pub fi } function x() { if [ -f "$1" ] ; then case $(file -biz "$1") in *application/x-tar*application/x-compress*) cmd="tar -xzf $file" ;; *application/x-tar*) cmd="tar -xf $file" ;; *application/x-zip*) unziphack=1 cmd="unzip -qqo $file" ;; *application/x-cpio*) cmd="bsdtar -x -f $file" ;; *application/x-gzip*) cmd="gunzip -d -f $file" ;; *application/x-bzip*) cmd="bunzip2 -f $file" ;; esac else echo "'$1' is not a file" fi } #special screen-specific stuff for window titles case $TERM in screen*) trap 'echo -ne "\ek${BASH_COMMAND%%\ *}\e\\"' DEBUG PROMPT_COMMAND='echo -ne "\ek$(short_pwd 15)\e\\"' ;; esac #Different colors for remote server if [ "$(hostname)" = "home" ]; then PS1="\[\033[36m\]\u\[\033[37m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]$ " else PS1="\[\033[35m\]\u\[\033[37m\]@\[\033[31m\]\h:\[\033[34;1m\]\w\[\033[m\]$ " fi if tty -s; then motd #run this neat little script fi