This repository has been archived on 2022-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
prezto/modules/z/init.zsh

38 lines
599 B
Bash
Raw Normal View History

2012-01-31 23:37:51 -05:00
#
# Maintains a frequently used directory list for fast directory changes.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
2011-08-31 00:02:50 -04:00
2012-04-11 20:51:10 -04:00
_z_prefixes=(
''
'/usr/local'
'/opt/local'
"$(brew --prefix 2> /dev/null)"
)
for _z_prefix in "$_z_prefixes[@]"; do
_z_sh="${_z_prefix}/etc/profile.d/z.sh"
if [[ -s "$_z_sh" ]]; then
2012-04-11 20:51:10 -04:00
source "$_z_sh"
break
fi
done
unset _z_prefix{es,} _z_sh
2011-08-31 00:02:50 -04:00
if (( $+functions[_z] )); then
2012-04-11 21:00:40 -04:00
function _z-precmd {
_z --add "${PWD:A}"
2011-08-31 00:02:50 -04:00
}
2012-04-11 21:00:40 -04:00
2011-08-31 00:02:50 -04:00
autoload -Uz add-zsh-hook
2012-04-11 21:00:40 -04:00
add-zsh-hook precmd _z-precmd
alias z='nocorrect _z'
alias j='nocorrect _z'
2011-08-31 00:02:50 -04:00
fi