From: Francois Fleuret Date: Sun, 28 Aug 2011 22:01:29 +0000 (+0200) Subject: Patched selector-cd-search to take into account the selector-cd. X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=scripts.git;a=commitdiff_plain;h=f8342131f317c55351b29af45d640b007d66e754 Patched selector-cd-search to take into account the selector-cd. --- diff --git a/bashrc b/bashrc index 3b4910c..6c908f4 100644 --- a/bashrc +++ b/bashrc @@ -855,13 +855,6 @@ export SELECTOR_CD_HISTORY [[ "${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 @@ -871,6 +864,13 @@ function selector-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