From eb29987ce9962b6a8392757949e1785f4a20b7ed Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Sun, 9 Sep 2012 13:48:16 -0400 Subject: [PATCH] [Fix #277] Make the peepcode theme status symbol customizable --- .../prompt/functions/prompt_peepcode_setup | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/modules/prompt/functions/prompt_peepcode_setup b/modules/prompt/functions/prompt_peepcode_setup index fbb17ee..88c860d 100644 --- a/modules/prompt/functions/prompt_peepcode_setup +++ b/modules/prompt/functions/prompt_peepcode_setup @@ -51,12 +51,38 @@ function prompt_peepcode_setup { zstyle ':prezto:module:ruby' version ' %F{white}%v%f' # Define prompts. - PROMPT=' + PROMPT=" %~ -%(?.%F{green}☻%f.%F{red}☻%f) ' +%(?.%F{green}${1:-☻ }%f.%F{red}${1:-☻ }%f) " RPROMPT='${ruby_info[version]}${vcs_info_msg_0_}' } +function prompt_peepcode_help { + cat <] + +If this option is not provided, the symbol defaults to ☻. +EOH +} + +function prompt_peepcode_preview { + local +h PROMPT='%# ' + local +h RPROMPT='' + local +h SPROMPT='' + + if (( $# > 0 )); then + prompt_preview_theme 'peepcode' "$@" + else + prompt_preview_theme 'peepcode' + print + prompt_preview_theme 'peepcode' "❯" + print + prompt_preview_theme 'peepcode' "$" + fi +} + prompt_peepcode_setup "$@"