;;
esac
- OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \W \\$"
+ if [ -r "$HOME"/admin/prog/short_curdir ]; then
+ . "$HOME"/admin/prog/short_curdir
+ OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \`short_curdir\` \\$"
+ else
+ OPS1=${OPS1}"${debian_chroot:+($debian_chroot)}\u@\h \W \\$"
+ fi
. "$ENV"
else
fi
complete -W "`echo $BROWSER | sed 's/:/ /g'`" start-browser
+ if [ "`type -t short_curdir`" != function -a \
+ -r "$HOME"/admin/prog/short_curdir ]; then
+ . "$HOME"/admin/prog/short_curdir
+ fi
+
#if type -p pip >/dev/null 2>&1; then
# eval "`pip completion --bash`"
# rm -rf /tmp/pip_build_"$USER"
mc() {
if test -n "$BASH_VERSION"; then
MC_SAVE_OPS1="$OPS1"
- OPS1="\u@\h \W \\$"
+ if [ "`type -t short_curdir`" = function ]; then
+ OPS1="\u@\h \`short_curdir\` \\$"
+ else
+ OPS1="\u@\h \W \\$"
+ fi
fi
if [ -n "$SLOWTERM" ]; then
--- /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 15 ]; then
+ _short_curdir="${_short_curdir::15}..." # cut long string
+ fi
+ echo "${_short_curdir}"
+}