mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
This should be the bare minimum needed. Nothing bad will happen if a blank variable gets added to fpath or sourced. We don't need to check if its a file either since the globbing would already only return a file.
This commit is contained in:
parent
f31cd6a94e
commit
6b6a4216bf
1 changed files with 12 additions and 37 deletions
47
omz
47
omz
|
|
@ -10,49 +10,24 @@ omz() {
|
||||||
plugin=${plugin:=()}
|
plugin=${plugin:=()}
|
||||||
|
|
||||||
# add a function path
|
# add a function path
|
||||||
fpath=($ZSH/functions $ZSH/completions $fpath)
|
fpath=({$ZSH,$OMZ}/functions(N) {$ZSH,$OMZ}/completions(N) $fpath)
|
||||||
|
|
||||||
if [[ -d $OMZ ]]; then
|
# add plugins to fpath
|
||||||
[[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath)
|
for plugin ($plugins)
|
||||||
[[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath)
|
fpath=({$OMZ,$ZSH}/plugins/$plugin.plugin.zsh(N))
|
||||||
fi
|
|
||||||
|
|
||||||
for config_file ($ZSH/lib/*.zsh(N))
|
|
||||||
source $config_file
|
|
||||||
|
|
||||||
if [[ -d $OMZ ]]; then
|
|
||||||
for config_file ($OMZ/*.zsh(N))
|
|
||||||
source $config_file
|
|
||||||
fi
|
|
||||||
|
|
||||||
# for plugin ($plugins)
|
|
||||||
# fpath=($ZSH/plugins/$plugin $fpath)
|
|
||||||
|
|
||||||
# if [[ -d $OMZ ]]; then
|
|
||||||
# if [[ -d $OMZ/plugins ]]; then
|
|
||||||
# for plugin ($plugins)
|
|
||||||
# fpath=($OMZ/plugins/$plugin $fpath)
|
|
||||||
# fi
|
|
||||||
# fi
|
|
||||||
|
|
||||||
for plugin ($plugins); do
|
|
||||||
files=({$OMZ,$ZSH}/plugins/$plugin(N))
|
|
||||||
[[ -n $files[1] ]] && fpath=($files[1] $fpath) || omz_log_msg "$plugin not found."
|
|
||||||
done
|
|
||||||
|
|
||||||
# Load and run compinit
|
# Load and run compinit
|
||||||
autoload -U compinit
|
autoload -U compinit
|
||||||
compinit -i
|
compinit -i
|
||||||
|
|
||||||
# load plugins (TODO: Make this slimmer and better)
|
# load lib
|
||||||
# for plugin ($fpath/*.plugin.zsh(N)) source $plugin
|
for config_file ({$ZSH/lib,$OMZ}/*.zsh(N))
|
||||||
|
source $config_file
|
||||||
|
|
||||||
|
# load plugins
|
||||||
for plugin ($plugins); do
|
for plugin ($plugins); do
|
||||||
plugin_sub=$(basename $plugin)
|
files=({$OMZ,$ZSH}/plugins/$plugin.plugin.zsh(N))
|
||||||
if [[ -f $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then
|
source $files[1] || omz_log_msg "$plugin not found."
|
||||||
source $OMZ/plugins/$plugin/$plugin_sub.plugin.zsh
|
|
||||||
elif [[ -f $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh ]]; then
|
|
||||||
source $ZSH/plugins/$plugin/$plugin_sub.plugin.zsh
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
local theme
|
local theme
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue