From eae871da9ae8110e290b14f27e36c13b99889b10 Mon Sep 17 00:00:00 2001 From: Khalid Zubair Date: Thu, 9 Feb 2012 23:13:32 -0500 Subject: [PATCH] Add option to preserve paths with symlinks; Add a second command 's' to jump to a subdirectory --- autojump | 2 +- autojump.bash | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autojump b/autojump index 77f8b04..dbd9377 100755 --- a/autojump +++ b/autojump @@ -28,7 +28,7 @@ from operator import itemgetter import os import shutil -AUTOJUMP_VERSION = "release-v19" +AUTOJUMP_VERSION = "release-v19-49-g8e86f08-dirty" MAX_KEYWEIGHT = 1000 MAX_STORED_PATHS = 600 COMPLETION_SEPARATOR = '__' diff --git a/autojump.bash b/autojump.bash index 914c374..f97a457 100644 --- a/autojump.bash +++ b/autojump.bash @@ -66,7 +66,13 @@ if [ -d ~/.autojump/ ]; then fi 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 *autojump*) ;; @@ -75,3 +81,5 @@ esac 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 s { j $PWD $@ ; } +