Patched selector-cd-search to take into account the selector-cd.
authorFrancois Fleuret <francois@fleuret.org>
Sun, 28 Aug 2011 22:01:29 +0000 (00:01 +0200)
committerFrancois Fleuret <francois@fleuret.org>
Sun, 28 Aug 2011 22:01:29 +0000 (00:01 +0200)
bashrc

diff --git a/bashrc b/bashrc
index 3b4910c..6c908f4 100644 (file)
--- 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