# Functions used in this file:
__has_parent_dir () {
# Utility function so we can test for things like .git/.hg without firing
# up a separate process
test -d "$1" && return 0;
current="."
while [ ! "$current" -ef "$current/.." ]; do
if [ -d "$current/$1" ]; then
return 0;
fi
current="$current/..";
done
return 1;
}
__vcs_name() {
if [ -d .svn ]; then
echo " [svn]";
elif [ -d RCS ]; then
echo " [RCS]";
elif __has_parent_dir ".git"; then
echo "$(__git_ps1 ' [git %s]')";
elif __has_parent_dir ".hg"; then
echo " [hg $(hg branch)]"
fi
}
PS1='\[\033]0;\u@\h:\w\007\]\u@\h:\w$(__vcs_name) $ '
shopt -s histappend
PROMPT_COMMAND='history -a'
MANPATH=~/man:$MANPATH
export PIP_REQUIRE_VIRTUALENV=true
if [ ! -z `which virtualenvwrapper_bashrc 2>/dev/null` ]; then
export WORKON_HOME=$HOME/.virtualenvs
export PIP_VIRTUALENV_BASE=$WORKON_HOME
. `which virtualenvwrapper_bashrc`
fi
if [ -f /etc/bash_completion.d/* ]; then
for c in /etc/bash_completion.d/*; do
. "$c"
done
fi
if [ -f ~/.bash_completion.d/* ]; then
for c in ~/.bash_completion.d/*; do
. "$c"
done
fi
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
source ~/.bashrc
if [ -f ~/.bashrc.local ]; then
. ~/.bashrc.local
fi
if [ -f ~/.pythonstartup ]; then
export PYTHONSTARTUP=$HOME/.pythonstartup
fi
if [ -d /opt/local ]; then
export MANPATH=/opt/local/share/man:$MANPATH
export PATH=/opt/local/sbin:/opt/local/bin:$PATH
fi
if [ -d /usr/local/git ]; then
export MANPATH=/usr/local/git/man:$MANPATH
export PATH=/usr/local/git/bin:$PATH
fi
PS1='\[\033]0;\u@\h:\w\007\]\u@\h:\w$(__vcs_name) $ '
shopt -s histappend
PROMPT_COMMAND='history -a'
MANPATH=~/man:$MANPATH
HISTCONTROL=ignorespace:ignoredups
HISTSIZE=2000