You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
495 B

# prompt setup function common to many prompts
# moved to external function to reduce code redundancy
setopt localoptions extendedglob
local current_pwd="${PWD/#$HOME/~}"
local ret_directory
if [[ "$current_pwd" == (#m)[/~] ]]; then
ret_directory="$MATCH"
unset MATCH
elif zstyle -t ':prezto:module:prompt' long-pwd; then
ret_directory=${current_pwd}
else
ret_directory="${${${${(@j:/:M)${(@s:/:)current_pwd}##.#?}:h}%/}//\%/%%}/${${current_pwd:t}//\%/%%}"
fi
print "$ret_directory"