autoload -U compinit compinit setopt correct setopt cdable_vars setopt extended_glob setopt prompt_subst setopt histignoredups bindkey -v # apparently this is a bad way to do this. http://www.kdedevelopers.org/node/4051 function precmd { git_ps1 () { local dirty='' local st="$(git status 2> /dev/null | tail -n1)" if [ "$st" = "nothing added to commit but untracked files present (use \"git add\" to track)" ]; then dirty='**' elif [ "$st" != "nothing to commit (working directory clean)" ]; then dirty='*' fi local branch="$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')" if [ -n "$branch" ]; then printf " [%s]" "$branch$dirty" fi } GITBRANCH="$(git_ps1)" } PROMPT=$'%{\e[1;34m%}%n@%m %2~$GITBRANCH %(!.#.$)%{\e[1;00m%} ' RPROMPT='%(?..%?)' tab () { osascript 2>/dev/null <