Skip to content

Instantly share code, notes, and snippets.

@amiel

amiel/.bashrc

Created Jun 18, 2009
Embed
What would you like to do?
export PATH="/usr/local/texlive/2008/bin/universal-darwin/:/opt/local/bin:/opt/local/sbin:$PATH:~/bin:/usr/local/mysql-5.0.67-osx10.5-x86/bin/:/usr/local/bin"
export MANPATH=/opt/local/share/man:$MANPATH
export LC_CTYPE=en_US.UTF-8
alias irb='irb --readline -r irb/completion'
# alias mate='open -a TextMate.app'
alias e=mate
alias gb='for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cblue%cr%Creset" $k|head -n 1`\\t$k;done'
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /'
}
red='\e[0;31m'
RED='\e[1;31m'
green='\e[0;32m'
GREEN='\e[1;32m'
yellow='\e[0;33m'
YELLOW='\e[1;33m'
blue='\e[0;34m'
BLUE='\e[1;34m'
purple='\e[0;35m'
PURPLE='\e[1;35m'
cyan='\e[0;36m'
CYAN='\e[1;36m'
NC='\e[0m'
case "$HOSTNAME" in
hobbes.local)
hostcolor=$BLUE
;;
*)
hostcolor=$YELLOW
;;
esac
case "$TERM_PROGRAM" in
Apple_Terminal|GLterm|xterm|iTerm)
#local ps1 screen host
if [ $TERM == "screen" ];then
screen="\[${YELLOW}\]$WINDOW\[$NC\] "
fi
if echo $HOSTNAME|grep -q myvzw;then
PROMPT_COMMAND='echo -ne "\033]0;${USER}@v_hobbes: ${PWD}\007"'
host="\[${red}\]v-hobbes\[$NC\]"
else
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
host="\[${hostcolor}\]\h\[$NC\]"
fi
export PS1="\[${cyan}\]\u@\[$NC\]$host \[${purple}\]\W\[$NC\] $screen\[${GREEN}\]\$(parse_git_branch)\[$NC\]\$ "
;;
*)
export PS1='\h:\u \W\$ '
;;
esac
#export EDITOR=vim
export EDITOR="mate -w"
export LESSEDIT='mate -l %lm %f'
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.