scd.plugin.zsh
455 bytes
1## The scd script should autoload as a shell function.
2autoload -Uz scd
3
4
5## If the scd function exists, define a change-directory-hook function
6## to record visited directories in the scd index.
7if [[ ${+functions[scd]} == 1 ]]; then
8 chpwd_scd() { scd --add $PWD }
9 autoload -Uz add-zsh-hook
10 add-zsh-hook chpwd chpwd_scd
11fi
12
13
14## Load the directory aliases created by scd if any.
15if [[ -s ~/.scdalias.zsh ]]; then
16 source ~/.scdalias.zsh
17fi