From 6ea126caab04c687eea41fd0c3ecda2bbe4c27fe Mon Sep 17 00:00:00 2001 From: avery Date: Fri, 17 Aug 2012 10:02:11 -0400 Subject: [PATCH] Added personal theme --- themes/haplesshero13.zsh-theme | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 themes/haplesshero13.zsh-theme diff --git a/themes/haplesshero13.zsh-theme b/themes/haplesshero13.zsh-theme new file mode 100644 index 000000000..d6f8b383c --- /dev/null +++ b/themes/haplesshero13.zsh-theme @@ -0,0 +1,58 @@ +# An informative prompt that gives you hg and git repository info, +# as well as return code, RVM/rubenv info, and standard hostname, path, user. +# by Avery Yen +# +# Hosted at +# +# Requires hg-prompt +# +# Stolen mostly from +# and alanpeabody.zsh-theme from Oh-My-Zsh. +# +# Left prompt is modified version of the Bash prompt by AntiGenX +# + +# From Steve Losh +function prompt_char { + git branch >/dev/null 2>/dev/null && echo 'λ' && return + hg root >/dev/null 2>/dev/null && echo '☿' && return + echo '$' +} + +function hg_prompt_info { + hg prompt --angle-brackets "\ +< %{$fg[magenta]%}%{$reset_color%}>\ +< %{$fg[yellow]%}%{$reset_color%}>\ +%{$fg[green]%}%{$reset_color%}< +patches: >" 2>/dev/null +} + +HGPROMPT='$(hg_prompt_info)' + +ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[magenta]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="" +ZSH_THEME_GIT_PROMPT_CLEAN="" + +# From Alan Peabody +ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[green]%} ✚" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[blue]%} ✹" +ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✖" +ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[magenta]%} ➜" +ZSH_THEME_GIT_PROMPT_UNMERGED="%{$fg[yellow]%} ═" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[cyan]%} ✭" + +local rvm='' +if which rvm-prompt &> /dev/null; then + rvm='%{$fg[green]%}‹$(rvm-prompt i v g)›%{$reset_color%}' +else + if which rbenv &> /dev/null; then + rvm='%{$fg[green]%}‹$(rbenv version | sed -e "s/ (set.*$//")›%{$reset_color%}' + fi +fi +local return_code='%(?..%{$fg[red]%}%? ↵%{$reset_color%})' +local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' + +# Inspired by AntiGenX's Bash prompt +PROMPT='%{$fg[cyan]%}%m:%{$reset_color%}%~:%{$fg[blue]%}%n%{$reset_color%}$(prompt_char) ' +RPROMPT="${return_code} $HGPROMPT ${git_branch} ${rvm}"