|
|
@ -1,15 +1,20 @@
|
|
|
|
# set paths for user installations
|
|
|
|
# set user installation paths
|
|
|
|
if [[ -d ${HOME}/.autojump ]]; then
|
|
|
|
if [[ -d ${HOME}/.autojump ]]; then
|
|
|
|
path=(${HOME}/.autojump/bin ${path})
|
|
|
|
path=(${HOME}/.autojump/bin ${path})
|
|
|
|
fpath=(${HOME}/.autojump/functions/ ${fpath})
|
|
|
|
fpath=(${HOME}/.autojump/functions/ ${fpath})
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# set fpath if necessary for homebrew installation
|
|
|
|
|
|
|
|
|
|
|
|
# set homebrew installation paths
|
|
|
|
command -v brew &>/dev/null \
|
|
|
|
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})
|
|
|
|
|
|
|
|
|
|
|
|
# add change pwd hook
|
|
|
|
|
|
|
|
|
|
|
|
# tab completion handled by _j file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# change pwd hook
|
|
|
|
autojump_chpwd() {
|
|
|
|
autojump_chpwd() {
|
|
|
|
(autojump -a "$(pwd)" &) &>/dev/null
|
|
|
|
(autojump -a "$(pwd)" &) &>/dev/null
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -17,6 +22,7 @@ autojump_chpwd() {
|
|
|
|
typeset -gaU chpwd_functions
|
|
|
|
typeset -gaU chpwd_functions
|
|
|
|
chpwd_functions+=autojump_chpwd
|
|
|
|
chpwd_functions+=autojump_chpwd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# default autojump command
|
|
|
|
# default autojump command
|
|
|
|
j() {
|
|
|
|
j() {
|
|
|
|
if [[ ${@} == -* ]]; then
|
|
|
|
if [[ ${@} == -* ]]; then
|
|
|
@ -35,6 +41,7 @@ j() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# jump to child directory (subdirectory of current path)
|
|
|
|
# jump to child directory (subdirectory of current path)
|
|
|
|
jc() {
|
|
|
|
jc() {
|
|
|
|
if [[ ${@} == -* ]]; then
|
|
|
|
if [[ ${@} == -* ]]; then
|
|
|
@ -44,6 +51,7 @@ jc() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# open autojump results in file browser
|
|
|
|
# open autojump results in file browser
|
|
|
|
jo() {
|
|
|
|
jo() {
|
|
|
|
if [[ ${@} == -* ]]; then
|
|
|
|
if [[ ${@} == -* ]]; then
|
|
|
@ -74,6 +82,7 @@ jo() {
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# open autojump results (child directory) in file browser
|
|
|
|
# open autojump results (child directory) in file browser
|
|
|
|
jco() {
|
|
|
|
jco() {
|
|
|
|
if [[ ${@} == -* ]]; then
|
|
|
|
if [[ ${@} == -* ]]; then
|
|
|
|