mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Add option to preserve paths with symlinks; Add a second command 's' to jump to a subdirectory
This commit is contained in:
parent
8e86f08625
commit
eae871da9a
2
autojump
2
autojump
@ -28,7 +28,7 @@ from operator import itemgetter
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
AUTOJUMP_VERSION = "release-v19"
|
AUTOJUMP_VERSION = "release-v19-49-g8e86f08-dirty"
|
||||||
MAX_KEYWEIGHT = 1000
|
MAX_KEYWEIGHT = 1000
|
||||||
MAX_STORED_PATHS = 600
|
MAX_STORED_PATHS = 600
|
||||||
COMPLETION_SEPARATOR = '__'
|
COMPLETION_SEPARATOR = '__'
|
||||||
|
@ -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,5 @@ 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 }
|
||||||
|
function s { j $PWD $@ ; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user