2016-01-05 04:11:20 -05:00
|
|
|
# shortens the pwd for use in prompt
|
|
|
|
|
2018-09-13 11:10:49 -04:00
|
|
|
local current_dir="${${1:-${PWD}}/#${HOME}/~}"
|
2016-03-25 17:37:00 -04:00
|
|
|
|
2016-01-05 04:11:20 -05:00
|
|
|
# if we aren't in ~
|
|
|
|
if [[ ${current_dir} != '~' ]]; then
|
2018-09-13 11:10:49 -04:00
|
|
|
current_dir="${${${${(@j:/:M)${(@s:/:)current_dir}##.#?}:h}%/}//\%/%%}/${${current_dir:t}//\%/%%}"
|
2016-01-05 04:11:20 -05:00
|
|
|
fi
|
|
|
|
|
2018-09-13 11:10:49 -04:00
|
|
|
print ${current_dir}
|