From afbb092430baff0f1d7e665e98d102694e50a5ff Mon Sep 17 00:00:00 2001 From: Matt Briggs Date: Sun, 13 Nov 2011 15:54:01 -0500 Subject: [PATCH] adds a ruby/git oriented theme --- themes/mbriggs/mbriggs.theme.bash | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 themes/mbriggs/mbriggs.theme.bash diff --git a/themes/mbriggs/mbriggs.theme.bash b/themes/mbriggs/mbriggs.theme.bash new file mode 100644 index 0000000..7a79b26 --- /dev/null +++ b/themes/mbriggs/mbriggs.theme.bash @@ -0,0 +1,34 @@ +# ------------------------------------------------------------------# +# FILE: mbriggs.zsh-theme # +# BY: Matt Briggs (matt@mattbriggs.net) # +# BASED ON: smt by Stephen Tudor (stephen@tudorstudio.com) # +# ------------------------------------------------------------------# + +SCM_THEME_PROMPT_DIRTY="${red}⚡${reset_color}" +SCM_THEME_PROMPT_AHEAD="${red}!${reset_color}" +SCM_THEME_PROMPT_CLEAN="${green}✓${reset_color}" +SCM_THEME_PROMPT_PREFIX=" " +SCM_THEME_PROMPT_SUFFIX="" +GIT_SHA_PREFIX=" ${yellow}" +GIT_SHA_SUFFIX="${reset_color}" + +function git_short_sha() { + SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX" +} + +function prompt() { + local return_status="" + local rvm_ruby="${red}$(rvm-prompt i)${reset_color}" + local user_host="${green}\h${reset_color}" + local current_path="\w" + local n_commands="\!" + local git_branch="$(git_short_sha)$(scm_prompt_info)" + local prompt_symbol='λ' + local open='(' + local close=')' + local prompt_char=' \$ ' + + PS1="\n${n_commands} ${user_host} ${prompt_symbol} ${rvm_ruby} ${open}${current_path}${git_branch}${close}${return_status}\n${prompt_char}" +} + +PROMPT_COMMAND=prompt \ No newline at end of file -- 2.17.1