mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Merge pull request #106 from statik213/master
Add option to preserve symlinks and another command "s" to jump sub directories
This commit is contained in:
commit
cfda2d0cd9
@ -66,7 +66,13 @@ if [ -d ~/.autojump/ ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
export AUTOJUMP_HOME=${HOME}
|
export AUTOJUMP_HOME=${HOME}
|
||||||
AUTOJUMP='{ [[ "$AUTOJUMP_HOME" == "$HOME" ]] && (autojump -a "$(pwd -P)"&)>/dev/null 2>>"${AUTOJUMP_DATA_DIR}/.autojump_errors";} 2>/dev/null'
|
if [ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]
|
||||||
|
then
|
||||||
|
_PWD_ARGS=""
|
||||||
|
else
|
||||||
|
_PWD_ARGS="-P"
|
||||||
|
fi
|
||||||
|
AUTOJUMP='{ [[ "$AUTOJUMP_HOME" == "$HOME" ]] && (autojump -a "$(pwd ${_PWD_ARGS})"&)>/dev/null 2>>"${AUTOJUMP_DATA_DIR}/.autojump_errors";} 2>/dev/null'
|
||||||
|
|
||||||
case $PROMPT_COMMAND in
|
case $PROMPT_COMMAND in
|
||||||
*autojump*) ;;
|
*autojump*) ;;
|
||||||
@ -75,3 +81,4 @@ esac
|
|||||||
|
|
||||||
alias jumpstat="autojump --stat"
|
alias jumpstat="autojump --stat"
|
||||||
function j { new_path="$(autojump $@)";if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "$new_path";else false; fi }
|
function j { new_path="$(autojump $@)";if [ -n "$new_path" ]; then echo -e "\\033[31m${new_path}\\033[0m"; cd "$new_path";else false; fi }
|
||||||
|
|
||||||
|
@ -35,7 +35,13 @@ if [[ -d ~/.autojump/ ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
function autojump_preexec() {
|
function autojump_preexec() {
|
||||||
{ (autojump -a "$(pwd -P)"&)>/dev/null 2>>|${AUTOJUMP_DATA_DIR}/.autojump_errors ; } 2>/dev/null
|
if [[ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]]
|
||||||
|
then
|
||||||
|
_PWD_ARGS=""
|
||||||
|
else
|
||||||
|
_PWD_ARGS="-P"
|
||||||
|
fi
|
||||||
|
{ (autojump -a "$(pwd ${_PWD_ARGS})"&)>/dev/null 2>>|${AUTOJUMP_DATA_DIR}/.autojump_errors ; } 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
typeset -ga preexec_functions
|
typeset -ga preexec_functions
|
||||||
|
Loading…
Reference in New Issue
Block a user