mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
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.
This commit is contained in:
parent
c2ae9e09ca
commit
1d9ee917c5
1 changed files with 10 additions and 6 deletions
16
oh-my-zsh.sh
16
oh-my-zsh.sh
|
|
@ -9,9 +9,16 @@ fi
|
|||
# add a function path
|
||||
fpath=($ZSH/functions $ZSH/completions $fpath)
|
||||
|
||||
# Load all of the config files in ~/oh-my-zsh that end in .zsh
|
||||
# TIP: Add files you don't want in git to .gitignore
|
||||
for config_file ($ZSH/lib/*.zsh) source $config_file
|
||||
# Load all library config files in the lib/ folder. If a config file with the
|
||||
# same name exists under custom/ load that instead. This allows you to override
|
||||
# default behaviors
|
||||
for library ($ZSH/lib/*.zsh); do
|
||||
if [ -f $ZSH/custom/$library:t ]; then
|
||||
source $ZSH/custom/$library:t
|
||||
elif [ -f $library ]; then
|
||||
source $library
|
||||
fi
|
||||
done
|
||||
|
||||
# Set ZSH_CUSTOM to the path where your custom config files
|
||||
# and plugins exists, or else we will use the default custom/
|
||||
|
|
@ -50,9 +57,6 @@ for plugin ($plugins); do
|
|||
fi
|
||||
done
|
||||
|
||||
# Load all of your custom configurations from custom/
|
||||
for config_file ($ZSH_CUSTOM/*.zsh(N)) source $config_file
|
||||
|
||||
# Load the theme
|
||||
if [ "$ZSH_THEME" = "random" ]
|
||||
then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue