updated title.sh

pull/2/head
Hari Sekhon 5 years ago
parent 62d0d281db
commit f010076877

@ -130,3 +130,34 @@ sudo(){
command sudo "$@"
title "$LAST_TITLE"
}
vim(){
local title=""
#until [ -z "$1" ]; do
for x in "$@"; do
case "$x" in
-*) :
;;
+*) :
;;
*) title="$title$x "
;;
esac
#shift
done
local num=10
[ -f ~/shorttitle ] && num=3
title="${title//.txt/}"
#if dpstatus >/dev/null; then
if echo "$title" | grep -q docs/; then
title="$(basename "$title")"
title "d${title:0:$num}"
else
title="$(basename "$title")"
title "${title:0:$num}"
fi
#fi
command vim "$@"
if dpstatus >/dev/null; then title; fi
}

Loading…
Cancel
Save