}
# c. better cd
-if type -p wcd &>/dev/null; then
- if [[ $LC_INSIDE_EMACS ]]; then
- c() { wcd -c -z 50 -o "$@"; }
+if ! type -t c &>/dev/null; then
+ if type -p wcd &>/dev/null; then
+ if [[ $LC_INSIDE_EMACS ]]; then
+ c() { wcd -c -z 50 -o "$@"; }
+ else
+ # lets see what the fancy terminal does from time to time
+ c() { wcd -c -z 50 "$@"; }
+ fi
else
- # lets see what the fancy terminal does from time to time
- c() { wcd -c -z 50 "$@"; }
+ c() { cd "$@"; }
fi
-else
- c() { cd "$@"; }
fi
ccomp cd c
fi
f="${arg##*/}"
new="${f,,}" # downcase
- new="${new//[^[:alnum:]._-]/_}" # sub bad chars
+ new="${new//[^a-zA-Z0-9._-]/_}" # sub bad chars
new="${new#"${new%%[[:alnum:]]*}"}" # remove leading/trailing non-alnum
new="${new%"${new##*[[:alnum:]]}"}"
# remove bad underscores, like __ and _._