From cd387dba2770da39c8384d9f3a9367b8d7467fba Mon Sep 17 00:00:00 2001 From: Shawn Sorichetti Date: Thu, 26 Jan 2012 10:38:16 -0500 Subject: [PATCH] Create my own theme to customize the prompts based on git_prompt_staus. Theme is based on Steve Losh's prose.zsh-theme. --- themes/hide.zsh-theme | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 themes/hide.zsh-theme diff --git a/themes/hide.zsh-theme b/themes/hide.zsh-theme new file mode 100644 index 000000000..4c116be0f --- /dev/null +++ b/themes/hide.zsh-theme @@ -0,0 +1,34 @@ +if [ "x$OH_MY_ZSH_HG" = "x" ]; then + OH_MY_ZSH_HG="hg" +fi + +function virtualenv_info { + [ $VIRTUAL_ENV ] && echo '('`basename $VIRTUAL_ENV`') ' +} + +function hg_prompt_info { + $OH_MY_ZSH_HG prompt --angle-brackets "\ +< on %{$fg[magenta]%}%{$reset_color%}>\ +< at %{$fg[yellow]%}%{$reset_color%}>\ +%{$fg[green]%}%{$reset_color%}< +patches: >" 2>/dev/null +} + +function box_name { + [ -f ~/.box-name ] && cat ~/.box-name || hostname -s +} + + +ZSH_THEME_GIT_PROMPT_PREFIX=" on %{$fg[magenta]%}" +ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" +ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}:" +ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[green]%}!" +ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg[green]%}?" +ZSH_THEME_GIT_PROMPT_CLEAN=":" + +PROMPT=' +%{$fg[magenta]%}%n%{$reset_color%} at %{$fg[yellow]%}$(box_name)%{$reset_color%} in %{$fg_bold[green]%}${PWD/#$HOME/~}%{$reset_color%}$(hg_prompt_info)$(git_prompt_info)$(git_prompt_status) +$(virtualenv_info)$ ' + +local return_status="%{$fg[red]%}%(?..⏎)%{$reset_color%}" +RPROMPT='${return_status}%{$reset_color%}'