1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

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

This commit is contained in:
William Ting 2013-02-01 13:50:52 -06:00
parent c16b305e0d
commit d57e7b779c
5 changed files with 56 additions and 2 deletions

View File

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

View File

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

View File

@ -93,3 +93,28 @@ function jc {
j $(pwd) ${@} j $(pwd) ${@}
fi 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
}

View File

@ -23,6 +23,7 @@ command -v brew &>/dev/null \
&& [[ -d "`brew --prefix`/share/zsh/site-functions" ]] \ && [[ -d "`brew --prefix`/share/zsh/site-functions" ]] \
&& fpath=(`brew --prefix`/share/zsh/site-functions ${fpath}) && fpath=(`brew --prefix`/share/zsh/site-functions ${fpath})
# TODO: switch this to a chpwd hook instead (2013.02.01_1319, ting)
function autojump_preexec() { function autojump_preexec() {
if [[ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]]; then if [[ "${AUTOJUMP_KEEP_SYMLINKS}" == "1" ]]; then
_PWD_ARGS="" _PWD_ARGS=""
@ -37,6 +38,7 @@ preexec_functions+=autojump_preexec
function j { function j {
# Cannot use =~ due to MacPorts zsh v4.2, see issue #125. # Cannot use =~ due to MacPorts zsh v4.2, see issue #125.
echo "j()"
if [[ ${@} == -* ]]; then if [[ ${@} == -* ]]; then
autojump ${@} autojump ${@}
return return
@ -54,9 +56,35 @@ function j {
} }
function jc { function jc {
echo "j()"
if [[ ${@} == -* ]]; then if [[ ${@} == -* ]]; then
j ${@} j ${@}
else else
j $(pwd) ${@} j $(pwd) ${@}
fi 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
}

View File

@ -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.bash ${destdir}etc/profile.d/ || exit 1
cp -v ./bin/autojump.zsh ${destdir}etc/profile.d/ || exit 1 cp -v ./bin/autojump.zsh ${destdir}etc/profile.d/ || exit 1
mkdir -p ${destdir}${zshsharedir} || 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 install -v -m 0755 ./bin/_j ${destdir}${zshsharedir} || exit 1
# MODIFY AUTOJUMP.SH FOR CUSTOM INSTALLS # MODIFY AUTOJUMP.SH FOR CUSTOM INSTALLS