From c109f3fc07b8ea06e70823147910fd4212ea4d2a Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Wed, 11 Apr 2012 21:00:40 -0400 Subject: [PATCH] Refactor z initialization --- modules/z/init.zsh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/z/init.zsh b/modules/z/init.zsh index 2fc82c94..50869195 100644 --- a/modules/z/init.zsh +++ b/modules/z/init.zsh @@ -24,12 +24,14 @@ done unset _z_prefix{es,} _z_sh if (( $+functions[_z] )); then - alias z='nocorrect _z 2>&1' - alias j='z' - function z-precmd { - z --add "$(pwd -P)" + function _z-precmd { + _z --add "${PWD:A}" } + autoload -Uz add-zsh-hook - add-zsh-hook precmd z-precmd + add-zsh-hook precmd _z-precmd + + alias z='nocorrect _z' + alias j='nocorrect _z' fi