Instead of the normal cd I've created my own function
function cd {
builtin cd "$@" && ls -F
}
This works great for when I use commands like cd someDir/subDir
but not when I change directories via zsh's auto_cd someDir/subDir
.
Is there a way to customize what command gets called for auto_cd
?
Best Answer
The typical way to run-some-command-on-the-changing-of-the-directory is via the
chpwd
hook function (or list of functions named in the appropriately namedchpwd_functions
array):