# .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi shopt -s histappend EDITOR="emacsclient" export EDITOR _format_wd () { pwd=$(pwd) base=$(basename $pwd) parent=$(basename $(dirname $pwd)) pparent=$(basename $(dirname $parent)) if test $pparent != "/"; then echo -n "$parent/"; echo -n $base; else if test $parent != "/"; then echo -n "/$parent/" echo -n $base; else echo -n "/"; echo -n $base; fi fi } _format_inroot_dir () { if test -z "$INROOT_DIR" && test -n "$CERTIFIED_GNOMIE"; then # sort of a hack... INROOT_DIR="$MONO_GAC_PREFIX" fi if test -n "$INROOT_DIR"; then echo " [root=$INROOT_DIR]" fi } _format_uid () { if test $(id -u) = '0'; then echo -n " <"; echo -n "uid=0"; echo -n ">"; fi } PS1_PREFIX='$(_format_wd)$(_format_uid)$(_format_inroot_dir)' if test -n "$BASH_COMPLETION" && test -f /etc/bash_completion.d/git; then PS1_PREFIX="$PS1_PREFIX"'$(__git_ps1 " [git %s]")' fi PS1="$PS1_PREFIX"' \$ ' export PS1