Add pwd-length option 'tail'

This option makes `prompt-pwd` only show the last directory in the path,
for minimalist prompts
This commit is contained in:
Zoey Llewellyn Hewll 2017-10-01 12:03:45 +08:00
parent b3a2a7bfeb
commit 2afa8e43ae

View file

@ -19,6 +19,8 @@ elif [[ "$current_pwd" == (#m)[/~] ]]; then
unset MATCH
elif zstyle -m ':prezto:module:prompt' pwd-length 'long'; then
ret_directory=${current_pwd}
elif zstyle -m ':prezto:module:prompt' pwd-length 'tail'; then
ret_directory=${current_pwd:t}
else
ret_directory="${${${${(@j:/:M)${(@s:/:)current_pwd}##.#?}:h}%/}//\%/%%}/${${current_pwd:t}//\%/%%}"
fi