[[ "${SELECTOR_CD_HISTORY}" ]] || \
SELECTOR_CD_HISTORY=${HOME}/.selector-cd-history
-function selector-cd-search () {
- PATH_TEMP=$(mktemp /tmp/selector-cd-path.XXXXXX)
- selector -t "cd" -l 10000 -d -i -c 7,4,0,5 -o ${PATH_TEMP} -q ${SELECTOR_CD_HISTORY}
- cd "$(cat ${PATH_TEMP} | sed -e 's!~!'${HOME}'!')"
- \rm ${PATH_TEMP}
-}
-
function selector-cd () {
if [[ -z "$1" ]]; then
cd
echo $PWD | sed -e "s!${HOME}!~!" >> ${SELECTOR_CD_HISTORY}
}
+function selector-cd-search () {
+ PATH_TEMP=$(mktemp /tmp/selector-cd-path.XXXXXX)
+ selector -t "cd" -l 10000 -d -i -c 7,4,0,7 -o ${PATH_TEMP} -q ${SELECTOR_CD_HISTORY}
+ selector-cd "$(cat ${PATH_TEMP} | sed -e 's!~!'${HOME}'!')"
+ \rm ${PATH_TEMP}
+}
+
alias cd=selector-cd
# M-c provides a dynamic list of directories to cd into