-# xterm titlebar displays 'hostname:workingdir'
-if tput hs || tput tsl &> /dev/null; then
- PROMPT_COMMAND='tput tsl; echo -n "$(hostname| cut -d. -f1):${PWD/$HOME/~}"; tput fsl;'
+# Sets colour scheme in apps like Vim
+export COLORFGBG="15;0"
+
+
+
+#############
+# Fancy PS1 #
+#############
+
+# Revision control status for git, hg, svn
+
+[ -r /usr/share/git/completion/git-prompt.sh ] && source /usr/share/git/completion/git-prompt.sh
+function my_git_ps1 {
+ find_up_recurse .git || return
+ GIT_PS1_SHOWDIRTYSTATE=1 \
+ GIT_PS1_SHOWUNTRACKEDFILES=1 \
+ __git_ps1 2> /dev/null
+}
+
+function my_hg_ps1 {
+ find_up_recurse .hg || return
+ b="$(hg branch 2>/dev/null)" || return
+ s="$(hg status | cut -c1 | sort -u | tr -d " \n")"
+ echo -n " ($b"
+ [ -n "$s" ] && echo -n " $s"
+ echo -n ")"
+}
+
+function my_svn_ps1 {
+ find_up_recurse .svn || return
+ s="$(svn status --ignore-externals 2>/dev/null | cut -c1 | sort -u | tr -d " \n")"
+ [ -z "$s" ] && return
+ echo -n " ($s)"
+}
+
+# Two line prompt
+
+PS1=''
+PS1="$PS1"'\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]'
+PS1="$PS1"'\[\033[01;36m\]$(my_git_ps1 ; my_hg_ps1 ; my_svn_ps1)\[\033[00m\]'
+PS1="$PS1"'\n\$ '
+
+
+
+################
+# xterm titles #
+################
+
+# hostname:workingdir
+DISPLAY_TITLE_COMMAND='echo -ne "\033]0;$(hostname| cut -d. -f1):${PWD/$HOME/~}\007"'
+
+if [[ "$TERM" =~ ^xterm ]]; then
+ PROMPT_COMMAND="$DISPLAY_TITLE_COMMAND"