User Tools

Site Tools


bashrc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
bashrc [2009/11/28 16:53] 92.195.113.39bashrc [2010/04/04 08:04] 92.195.154.51
Line 47: Line 47:
   # cleanup firefox 3 dbs   # cleanup firefox 3 dbs
   alias ffclean='for f in ~/.mozilla/firefox/*/*.sqlite; do echo $f; sqlite3 $f "VACUUM;"; done'   alias ffclean='for f in ~/.mozilla/firefox/*/*.sqlite; do echo $f; sqlite3 $f "VACUUM;"; done'
 +
 +  # current git branch for prompt below
 +  # http://techblog.floorplanner.com/2008/12/14/working-with-git-branches/
 +  parse_git_branch() {
 +    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\[\1\]/'
 +  }
  
   # set a fancy prompt and xterm title   # set a fancy prompt and xterm title
Line 54: Line 60:
       PS1="\[\033]2;\w\007\]\[\033[0;31m\]\u@\h:\w\\$\[\033[0;37m\] "       PS1="\[\033]2;\w\007\]\[\033[0;31m\]\u@\h:\w\\$\[\033[0;37m\] "
     else     else
-      PS1="\[\033]2;\w\007\]\[\033[0;32m\]\u@\h:\w\\$\[\033[0;37m\] "+      PS1='\[\033]2;\w\007\]\[\033[0;32m\]\u@\h\[\033[00;35m\]$(parse_git_branch)\[\033[0;32m\]:\w\\$\[\033[0;37m\] '
     fi     fi
   else   else
bashrc.txt · Last modified: 2010/04/28 18:45 by 92.195.193.18