add config variable to allow full PWD to be printed
This commit is contained in:
parent
4f19700919
commit
8a5803444e
1 changed files with 9 additions and 1 deletions
|
@ -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=''
|
||||
|
|
Loading…
Add table
Reference in a new issue