blob: 674085b62bbafd4844ce140519c9cd1e9dec476d [file] [log] [blame]
Matt Briggsafbb0922011-11-13 15:54:01 -05001# ------------------------------------------------------------------#
2# FILE: mbriggs.zsh-theme #
3# BY: Matt Briggs (matt@mattbriggs.net) #
4# BASED ON: smt by Stephen Tudor (stephen@tudorstudio.com) #
5# ------------------------------------------------------------------#
6
7SCM_THEME_PROMPT_DIRTY="${red}⚡${reset_color}"
8SCM_THEME_PROMPT_AHEAD="${red}!${reset_color}"
9SCM_THEME_PROMPT_CLEAN="${green}✓${reset_color}"
10SCM_THEME_PROMPT_PREFIX=" "
11SCM_THEME_PROMPT_SUFFIX=""
12GIT_SHA_PREFIX=" ${yellow}"
13GIT_SHA_SUFFIX="${reset_color}"
14
15function git_short_sha() {
16 SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX"
17}
18
19function prompt() {
20 local return_status=""
Robert Jung54ffcc02012-01-27 12:35:57 +010021 local ruby="${red}$(ruby_version_prompt)${reset_color}"
Matt Briggsafbb0922011-11-13 15:54:01 -050022 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
Robert Jung54ffcc02012-01-27 12:35:57 +010031 PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${ruby} ${open}${current_path}${git_branch}${close}${return_status}\n${prompt_char}"
Matt Briggsafbb0922011-11-13 15:54:01 -050032}
33
34PROMPT_COMMAND=prompt