c9d1be395d
We don't need a second variable.
10 wiersze
269 B
Text
10 wiersze
269 B
Text
# shortens the pwd for use in prompt
|
|
|
|
local current_dir="${${1:-${PWD}}/#${HOME}/~}"
|
|
|
|
# if we aren't in ~
|
|
if [[ ${current_dir} != '~' ]]; then
|
|
current_dir="${${${${(@j:/:M)${(@s:/:)current_dir}##.#?}:h}%/}//\%/%%}/${${current_dir:t}//\%/%%}"
|
|
fi
|
|
|
|
print ${current_dir}
|