mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-06 02:51:32 +01:00
Merge 86c44f3660 into 5fcb6e1263
This commit is contained in:
commit
0caae8a063
1 changed files with 28 additions and 16 deletions
44
oh-my-zsh.sh
44
oh-my-zsh.sh
|
|
@ -9,18 +9,36 @@ fi
|
||||||
# add a function path
|
# add a function path
|
||||||
fpath=($ZSH/functions $ZSH/completions $fpath)
|
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); do
|
|
||||||
source $config_file
|
|
||||||
done
|
|
||||||
|
|
||||||
# Set ZSH_CUSTOM to the path where your custom config files
|
# Set ZSH_CUSTOM to the path where your custom config files
|
||||||
# and plugins exists, or else we will use the default custom/
|
# and plugins exists, or else we will use the default custom/
|
||||||
if [[ -z "$ZSH_CUSTOM" ]]; then
|
if [[ -z "$ZSH_CUSTOM" ]]; then
|
||||||
ZSH_CUSTOM="$ZSH/custom"
|
ZSH_CUSTOM="$ZSH/custom"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Load all of the config files in ~/oh-my-zsh/lib that end in .zsh
|
||||||
|
# If file of the same is present in ~/oh-my-zsh/custom, source this one instead
|
||||||
|
# TIP: Add files you don't want in git to .gitignore
|
||||||
|
for config_file ($ZSH/lib/*.zsh); do
|
||||||
|
filename=$(basename "$config_file")
|
||||||
|
if [ -f $ZSH_CUSTOM/$filename ]; then
|
||||||
|
# echo "source $ZSH_CUSTOM/$filename"
|
||||||
|
source $ZSH_CUSTOM/$filename
|
||||||
|
elif [ -f $config_file ]; then
|
||||||
|
# echo "source $config_file"
|
||||||
|
source $config_file
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
unset config_file
|
||||||
|
|
||||||
|
# Now source all remaining .zsh scripts in ZSH_CUSTOM
|
||||||
|
for config_file ($ZSH_CUSTOM/*.zsh); do
|
||||||
|
filename=$(basename "$config_file")
|
||||||
|
if [ ! -f $ZSH/lib/$filename ]; then
|
||||||
|
# echo "source $config_file"
|
||||||
|
source $config_file
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
unset config_file
|
||||||
|
|
||||||
is_plugin() {
|
is_plugin() {
|
||||||
local base_dir=$1
|
local base_dir=$1
|
||||||
|
|
@ -32,7 +50,7 @@ is_plugin() {
|
||||||
# before running compinit.
|
# before running compinit.
|
||||||
for plugin ($plugins); do
|
for plugin ($plugins); do
|
||||||
if is_plugin $ZSH_CUSTOM $plugin; then
|
if is_plugin $ZSH_CUSTOM $plugin; then
|
||||||
fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
|
fpath=($ZSH_CUSTOM/$plugin $fpath)
|
||||||
elif is_plugin $ZSH $plugin; then
|
elif is_plugin $ZSH $plugin; then
|
||||||
fpath=($ZSH/plugins/$plugin $fpath)
|
fpath=($ZSH/plugins/$plugin $fpath)
|
||||||
fi
|
fi
|
||||||
|
|
@ -42,21 +60,15 @@ done
|
||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
compinit -i
|
compinit -i
|
||||||
|
|
||||||
|
|
||||||
# Load all of the plugins that were defined in ~/.zshrc
|
# Load all of the plugins that were defined in ~/.zshrc
|
||||||
for plugin ($plugins); do
|
for plugin ($plugins); do
|
||||||
if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
|
if [ -f $ZSH_CUSTOM/$plugin/$plugin.plugin.zsh ]; then
|
||||||
source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
|
source $ZSH_CUSTOM/$plugin/$plugin.plugin.zsh
|
||||||
elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
|
elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
|
||||||
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
unset plugin
|
||||||
# Load all of your custom configurations from custom/
|
|
||||||
for config_file ($ZSH_CUSTOM/*.zsh(N)); do
|
|
||||||
source $config_file
|
|
||||||
done
|
|
||||||
unset config_file
|
|
||||||
|
|
||||||
# Load the theme
|
# Load the theme
|
||||||
if [ "$ZSH_THEME" = "random" ]
|
if [ "$ZSH_THEME" = "random" ]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue