robbyrussell/oh-my-zsh — pull request #1364 by AnthonyDiGirolamo (2012-10-17 16:33:36+00:00)
Title: Allow custom/*.zsh configs to override lib/*.zsh files of the same name.

This lets you replace default oh-my-zsh behavior with settings more to your
liking. You can still add on to default oh-my-zsh settings by adding them to
`~/.zshrc` or directly to the `lib/*.zsh` files.

The README was a bit confusing regarding this. The first line in the
customization section says: "If you want to override any of the default
behavior, just add a new file (ending in .zsh) into the custom/ directory."

When I tried this I found that the `custom/*.zsh` files would get sourced in
addition to the defaults under `lib/` but not instead of. For example, I wanted
to remove all the aliases setup in `lib/directories.zsh` so I created
`custom/directories.zsh` containing only:

# Changing/making/removing directory
setopt auto_name_dirs
setopt auto_pushd
setopt pushd_ignore_dups

It turns out this file is sourced but `lib/directires.zsh` is also sourced so the
aliases within are still created.

This change will source the `custom/*.zsh` files in place of their brethren in `lib/*.zsh`