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 revision
Previous revision
Next revisionBoth sides next revision
bashrc [2009/05/16 14:54] andibashrc [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
Line 65: Line 71:
   fi   fi
  
-  # ssh keymanager - see http://wiki.splitbrain.org/ssh+  # ssh keymanager - see http://notes.splitbrain.org/ssh
   if [ -e /usr/bin/keychain ]; then   if [ -e /usr/bin/keychain ]; then
     keychain -q ~/.ssh/id_dsa     keychain -q ~/.ssh/id_dsa
Line 88: Line 94:
     unset td     unset td
   }   }
 +
 +  # set a sane editor
 +  if [ -e /usr/bin/vim ]; then
 +    export EDITOR=/usr/bin/vim
 +    alias vi=/usr/bin/vim
 +  fi
  
   # print a fortune cookie   # print a fortune cookie
-  if [ -e /usr/games/fortune ]; then+  if which fortune >/dev/null; then
     if [ -z "$COLORTERM" ]; then     if [ -z "$COLORTERM" ]; then
-      /usr/games/fortune -a -s+      fortune -a -s
     else     else
       echo -en "\033[0;36m"       echo -en "\033[0;36m"
-      /usr/games/fortune -a -s+      fortune -a -s
       echo -en "\033[0;37m"       echo -en "\033[0;37m"
     fi     fi
bashrc.txt · Last modified: 2010/04/28 18:45 by 92.195.193.18