+++ /dev/null
-short_curdir() {
- if [ "$PWD" = / ]; then
- echo /
- return
- fi
- if [ "$PWD" = "$HOME" ]; then
- echo "~"
- return
- fi
- local _short_curdir
- _short_curdir="${PWD##*/}" # cut all directories, get base name
- if [ "${#_short_curdir}" -gt 18 ]; then
- _short_curdir="${_short_curdir::15}..." # cut long string
- fi
- echo "${_short_curdir}"
-}