ohmyzsh/omz
James McGlashan 1234fac27f more consistaint
2011-12-06 17:38:45 +11:00

50 lines
1.1 KiB
Bash

# omz control center
omz() {
ZSH=${ZSH:-/usr/share/oh-my-zsh}
OMZ=${OMZ:-$HOME/.omz}
case "$1" in
"init")
local config_file plugin
plugin=${plugin:=()}
# add a function path
fpath=({$ZSH,$OMZ}/functions(N) {$ZSH,$OMZ}/completions(N) $fpath)
# add plugins to fpath
for plugin ($plugins); do
files=({$OMZ,$ZSH}/plugins/$plugin)
fpath=($files[1] $fpath)
done
# Load and run compinit
autoload -U compinit
compinit -i
# load lib
for config_file ({$ZSH/lib,$OMZ}/*.zsh(N))
source $config_file
omz plugin
omz theme
;;
"plugin")
# load plugins
for plugin ($plugins); do
files=({$OMZ,$ZSH}/plugins/$plugin/$(basename $plugin).plugin.zsh(N))
source $files[1] || omz_log_msg "$plugin not found."
done
;;
"theme")
local theme
zstyle -a :omz:style theme theme
[[ -f {$OMZ,$ZSH}/themes/$2.zsh-theme(N) ]] && theme=$2 || omz_log_msg "Theme: $2 not found."
set_theme $theme
;;
*)
echo "$0: invalid command $1" 2>&1
;;
esac
}
# vi: ft=zsh