Permalink
Browse files

Added bash config

  • Loading branch information...
1 parent 7a24b61 commit 4ce773af7deb90dbad6368f0ff47376a973cddc1 @jyurek committed Jul 13, 2010
Showing with 76 additions and 0 deletions.
  1. +76 −0 bashrc
View
@@ -0,0 +1,76 @@
+function parse_git_dirty {
+ [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo ''
+}
+
+function parse_git_branch {
+ git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1/"
+}
+
+function latest_command {
+ history | tail -n 1 | sed 's/[0-9 ]*\(.*\)/\1/'
+}
+
+function growl_latest_command {
+ latest_command | growlnotify -n "Command Prompt" `pwd` 1>/dev/null 2>&1
+}
+
+function prompt_command_function
+{
+ last_result="\[\e[33m\]$?\[\e[0m\]"
+ titlebar_last_command="\[\e]2;$(latest_command)\a\]"
+
+ growl_latest_command
+
+ git_branch=$(parse_git_branch)
+ git_dirty= #$(parse_git_dirty)
+
+ git_dirty=${git_dirty:+" \[\e[31m\]$git_dirty\[\e[0m\]"}
+ git_branch=${git_branch:+" (\[\e[35m\]${git_branch}\[\e[0m\]${git_dirty})"}
+
+ PS1="$titlebar_last_command$last_result \h:\[\e[32m\]\w\[\e[0m\] \u$git_branch\$ "
+}
+
+function gemcd {
+ cd `dirname \`gem which $1\``
+}
+
+export PROMPT_COMMAND=prompt_command_function
+
+export PATH=$HOME/.homebrew/bin:$HOME/.homebrew/sbin:$HOME:$PATH:/Library/PostgreSQL/8.4/bin:/usr/local/mysql/bin:/usr/local/ec2/bin:$HOME/bin
+export EDITOR=/usr/bin/vim
+
+export CDPATH=.:~:~/Development
+alias ...='cd ../..'
+alias ....='cd ../../..'
+alias .....='cd ../../../..'
+
+export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home/"
+export EC2_HOME="/Users/jyurek/.homebrew/Cellar/ec2-api-tools/1.3-46266/"
+export AWS_CONF_HOME=$HOME/.aws
+export EC2_GROUP=jyurek
+export EC2_AMITOOL_HOME="/Users/jyurek/.homebrew/Cellar/ec2-ami-tools/1.3-45758/jars"
+function load_aws
+{
+ . $AWS_CONF_HOME/$1
+}
+load_aws $EC2_GROUP
+
+export GOROOT=`brew --cellar`/go/HEAD
+export GOARCH=amd64
+export GOOS=darwin
+
+alias rerc='source ~/.bash_profile'
+alias l=ls
+alias ll='ls -la'
+alias s=true
+
+if [ -f `brew --prefix`/etc/bash_completion ]; then
+ . `brew --prefix`/etc/bash_completion
+fi
+
+if [ -f /Users/jyurek/.git-completion.bash ]; then
+ . /Users/jyurek/.git-completion.bash
+fi
+
+if [[ -s /Users/jyurek/.rvm/scripts/rvm ]] ; then source /Users/jyurek/.rvm/scripts/rvm ; fi
+

0 comments on commit 4ce773a

Please sign in to comment.