+ selector --bash -c 7,4,0,3 -q <(history)
+}
+
+# Find pathes in the history and make a list of the existing ones
+
+function selector-cd () {
+ CD_HISTORY=${HOME}/.selector-cd-history
+ if [[ $1 == "+" ]]; then
+ PATH_TEMP=$(mktemp /tmp/selector-cd-path.XXXXXX)
+ selector -d -i -o ${PATH_TEMP} ${CD_HISTORY}
+ cd $(cat ${PATH_TEMP} | sed -e "s|~|${HOME}|")
+ \rm ${PATH_TEMP}
+ else
+ cd $1 && echo $PWD | sed -e "s|${HOME}|~|" >> ${CD_HISTORY}
+ fi