scd.plugin.zsh 455 Bytes
Newer Older
1
## The scd script should autoload as a shell function.
Pavol Juhas's avatar
Pavol Juhas committed
2
autoload -Uz scd
3
4
5
6
7


## If the scd function exists, define a change-directory-hook function
## to record visited directories in the scd index.
if [[ ${+functions[scd]} == 1 ]]; then
Pavol Juhas's avatar
Pavol Juhas committed
8
9
10
    chpwd_scd() { scd --add $PWD }
    autoload -Uz add-zsh-hook
    add-zsh-hook chpwd chpwd_scd
11
12
13
14
fi


## Load the directory aliases created by scd if any.
Pavol Juhas's avatar
Pavol Juhas committed
15
16
17
if [[ -s ~/.scdalias.zsh ]]; then
    source ~/.scdalias.zsh
fi