add option to open file explorer window from the commandline, bump to 21.4.0

pull/180/head
William Ting 11 years ago
parent c16b305e0d
commit d57e7b779c

@ -86,7 +86,7 @@ Grab a copy of autojump:
Run the installation script:
cd autojump
./install.sh [ --local ] [ --zsh ]
./install.sh [ --local ]
and follow on screen instructions.

@ -34,7 +34,7 @@ import re
import shutil
from tempfile import NamedTemporaryFile
VERSION = 'release-v21.3.0'
VERSION = 'release-v21.4.0'
MAX_KEYWEIGHT = 1000
MAX_STORED_PATHS = 1000
COMPLETION_SEPARATOR = '__'

@ -93,3 +93,28 @@ function jc {
j $(pwd) ${@}
fi
}
function jo {
case ${OSTYPE} in
linux-gnu)
xdg-open $(autojump $@)
;;
darwin*)
open $(autojump $@)
;;
cygwin)
cmd /C start "" $(cygpath -w -a $(pwd))
;;
*)
echo "Unknown operating system." 1>&2
;;
esac
}
function jco {
if [[ ${@} == -* ]]; then
j ${@}
else
jo $(pwd) ${@}
fi
}

@ -23,6 +23,7 @@ command -v brew &>/dev/null \
&& [[ -d "`brew --prefix`/share/zsh/site-functions" ]] \
&& fpath=(`brew --prefix`/share/zsh/site-functions ${fpath})
# TODO: switch this to a chpwd hook instead (2013.02.01_1319, ting)
function autojump_preexec() {
if [[ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]]; then
_PWD_ARGS=""
@ -37,6 +38,7 @@ preexec_functions+=autojump_preexec
function j {
# Cannot use =~ due to MacPorts zsh v4.2, see issue #125.
echo "j()"
if [[ ${@} == -* ]]; then
autojump ${@}
return
@ -54,9 +56,35 @@ function j {
}
function jc {
echo "j()"
if [[ ${@} == -* ]]; then
j ${@}
else
j $(pwd) ${@}
fi
}
function jo {
case ${OSTYPE} in
linux-gnu)
xdg-open $(autojump $@)
;;
darwin*)
open $(autojump $@)
;;
cygwin)
cmd /C start "" $(cygpath -w -a $(pwd))
;;
*)
echo "Unknown operating system." 1>&2
;;
esac
}
function jco {
if [[ ${@} == -* ]]; then
j ${@}
else
jo $(pwd) ${@}
fi
}

@ -217,6 +217,7 @@ cp -v ./bin/autojump.sh ${destdir}etc/profile.d/ || exit 1
cp -v ./bin/autojump.bash ${destdir}etc/profile.d/ || exit 1
cp -v ./bin/autojump.zsh ${destdir}etc/profile.d/ || exit 1
mkdir -p ${destdir}${zshsharedir} || exit 1
# TODO: remove unused _j function (2013.02.01_1348, ting)
install -v -m 0755 ./bin/_j ${destdir}${zshsharedir} || exit 1
# MODIFY AUTOJUMP.SH FOR CUSTOM INSTALLS

Loading…
Cancel
Save