fix hook.zsh

This commit is contained in:
chenyc 2022-11-04 16:39:30 +08:00
parent e32d0671ff
commit 849fb714f8
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@ preexec_hook() { _cmd=($(echo $2)); print -n "\e]2;${(q)_cmd[1]}\a"; }
add-zsh-hook -Uz preexec preexec_hook add-zsh-hook -Uz preexec preexec_hook
# auto to last pwd # auto to last pwd
chpwd_hook() { echo $PWD > $ZSH/cache/currentdir } chpwd_hook() { echo $PWD > $OMZ/cache/currentdir }
add-zsh-hook -Uz chpwd chpwd_hook add-zsh-hook -Uz chpwd chpwd_hook
currentdir=$(cat $ZSH/cache/currentdir 2>/dev/null) currentdir=$(cat $OMZ/cache/currentdir 2>/dev/null)
[ -d "$currentdir" ] && cd $currentdir [ -d "$currentdir" ] && cd $currentdir