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
Last revisionBoth sides next revision
bashrc [2008/03/28 09:21] – fix terminal wrapping andibashrc [2010/04/21 14:31] 91.64.124.84
Line 14: Line 14:
 # be sure to do to all this on interactive shells only # be sure to do to all this on interactive shells only
 if [ "$PS1" ]; then if [ "$PS1" ]; then
 +  # load system defaults
 +  if [ -f /etc/profile ]; then
 +    . /etc/profile
 +  fi
  
   # handy file conversion tools   # handy file conversion tools
Line 25: Line 29:
   alias ll='ls -l'   alias ll='ls -l'
   alias la='ls -A'   alias la='ls -A'
-  alias l='ls -la'  +  alias l='ls -la' 
 +  export GREP_OPTIONS='--color=auto'
  
   # color in man pages http://icanhaz.com/colors   # color in man pages http://icanhaz.com/colors
Line 40: Line 45:
   alias rm='rm -i'   alias rm='rm -i'
   alias mv='mv -i'   alias mv='mv -i'
 +
 +  # cleanup firefox 3 dbs
 +  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 47: Line 61:
       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 58: Line 72:
   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 82: Line 96:
   }   }
  
-  # twitter client +  # set a sane editor 
-  twitter(){ +  if [ -e /usr/bin/vim ]; then 
-    local user='myusername'; +    export EDITOR=/usr/bin/vim 
-    local pass='mypass'; +    alias vi=/usr/bin/vim 
-    local twit=`echo -n "$@"+  fi
-    if [ -z "$twit" ]; then +
-        echo 'Enter your twit and hit return' +
-        read twit +
-    fi +
-    echo -n 'wait...' +
-    curl -u"$user:$pass" -dstatus="$twit" https://twitter.com/statuses/update.xml >/dev/null 2>&1 && echo 'okay' +
-  }+
  
   # 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