From 8a5803444e688b289de01ccbcd2dae9c8d20e312 Mon Sep 17 00:00:00 2001 From: Jason 'vanRijn' Kasper Date: Fri, 29 Jul 2016 15:09:07 -0400 Subject: [PATCH] add config variable to allow full PWD to be printed --- modules/prompt/functions/prompt_sorin_setup | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/prompt/functions/prompt_sorin_setup b/modules/prompt/functions/prompt_sorin_setup index e339dffe..86163516 100644 --- a/modules/prompt/functions/prompt_sorin_setup +++ b/modules/prompt/functions/prompt_sorin_setup @@ -38,8 +38,10 @@ function prompt_sorin_pwd { if [[ "$pwd" == (#m)[/~] ]]; then _prompt_sorin_pwd="$MATCH" unset MATCH - else + elif [[ "$SORIN_PROMPT_SHORT_PWD" == 'Y' ]]; then _prompt_sorin_pwd="${${${${(@j:/:M)${(@s:/:)pwd}##.#?}:h}%/}//\%/%%}/${${pwd:t}//\%/%%}" + else + _prompt_sorin_pwd="$pwd" fi } @@ -130,6 +132,12 @@ function prompt_sorin_setup { zstyle ':prezto:module:git:info:keys' format \ 'status' '$(coalesce "%b" "%p" "%c")%s%A%B%S%a%d%m%r%U%u' + # See if our user has turned off shortened pwd (default to on) + zstyle -s ':prezto:module:prompt:theme:sorin' shortPWD \ + 'SORIN_PROMPT_SHORT_PWD' \ + || SORIN_PROMPT_SHORT_PWD='Y' + SORIN_PROMPT_SHORT_PWD="${(C)SORIN_PROMPT_SHORT_PWD[1,1]}" + # Define prompts. PROMPT='${SSH_TTY:+"%F{9}%n%f%F{7}@%f%F{3}%m%f "}%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} ' RPROMPT=''