1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-07-06 07:19:43 +00:00
prezto/modules/z/init.zsh

36 lines
589 B
Bash
Raw Normal View History

2012-02-01 04:37:51 +00:00
#
# Maintains a frequently used directory list for fast directory changes.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
2011-08-31 04:02:50 +00:00
2012-04-12 00:51:10 +00: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 [[ -f "$_z_sh" ]]; then
source "$_z_sh"
break
fi
done
unset _z_prefix{es,} _z_sh
2011-08-31 04:02:50 +00:00
if (( $+functions[_z] )); then
alias z='nocorrect _z 2>&1'
alias j='z'
function z-precmd {
2011-08-31 04:02:50 +00:00
z --add "$(pwd -P)"
}
autoload -Uz add-zsh-hook
add-zsh-hook precmd z-precmd
fi