Matt Briggs | afbb092 | 2011-11-13 15:54:01 -0500 | [diff] [blame] | 1 | # ------------------------------------------------------------------# |
| 2 | # FILE: mbriggs.zsh-theme # |
| 3 | # BY: Matt Briggs (matt@mattbriggs.net) # |
| 4 | # BASED ON: smt by Stephen Tudor (stephen@tudorstudio.com) # |
| 5 | # ------------------------------------------------------------------# |
| 6 | |
| 7 | SCM_THEME_PROMPT_DIRTY="${red}⚡${reset_color}" |
| 8 | SCM_THEME_PROMPT_AHEAD="${red}!${reset_color}" |
| 9 | SCM_THEME_PROMPT_CLEAN="${green}✓${reset_color}" |
| 10 | SCM_THEME_PROMPT_PREFIX=" " |
| 11 | SCM_THEME_PROMPT_SUFFIX="" |
| 12 | GIT_SHA_PREFIX=" ${yellow}" |
| 13 | GIT_SHA_SUFFIX="${reset_color}" |
| 14 | |
| 15 | function git_short_sha() { |
| 16 | SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX" |
| 17 | } |
| 18 | |
| 19 | function prompt() { |
| 20 | local return_status="" |
| 21 | local rvm_ruby="${red}$(rvm-prompt i)${reset_color}" |
| 22 | local user_host="${green}\h${reset_color}" |
| 23 | local current_path="\w" |
| 24 | local n_commands="\!" |
| 25 | local git_branch="$(git_short_sha)$(scm_prompt_info)" |
| 26 | local prompt_symbol='λ' |
| 27 | local open='(' |
| 28 | local close=')' |
| 29 | local prompt_char=' \$ ' |
| 30 | |
| 31 | PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${rvm_ruby} ${open}${current_path}${git_branch}${close}${return_status}\n${prompt_char}" |
| 32 | } |
| 33 | |
| 34 | PROMPT_COMMAND=prompt |