mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
This should be interesting.
This commit is contained in:
parent
e7acbeada5
commit
c974f24fb5
2 changed files with 53 additions and 41 deletions
90
oh-my-zsh
90
oh-my-zsh
|
|
@ -1,51 +1,61 @@
|
||||||
# Initializes Oh My Zsh
|
# omz control center
|
||||||
oh-my-zsh() {
|
|
||||||
ZSH=${ZSH:-/usr/share/oh-my-zsh}
|
|
||||||
OMZ=${OMZ:-$HOME/.omz}
|
|
||||||
|
|
||||||
local config_file plugin
|
omz() {
|
||||||
plugin=${plugin:=()}
|
ZSH=${ZSH:-/usr/share/oh-my-zsh}
|
||||||
|
OMZ=${OMZ:-$HOME/.omz}
|
||||||
|
|
||||||
# add a function path
|
case "$1" in
|
||||||
fpath=($ZSH/functions $ZSH/completions $fpath)
|
"start")
|
||||||
|
local config_file plugin
|
||||||
|
plugin=${plugin:=()}
|
||||||
|
|
||||||
if [[ -d $OMZ ]]; then
|
# add a function path
|
||||||
[[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath)
|
fpath=($ZSH/functions $ZSH/completions $fpath)
|
||||||
[[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath)
|
|
||||||
fi
|
|
||||||
|
|
||||||
for config_file ($ZSH/lib/*.zsh(N))
|
if [[ -d $OMZ ]]; then
|
||||||
source $config_file
|
[[ -d $OMZ/functions ]] && fpath=($OMZ/functions $fpath)
|
||||||
|
[[ -d $OMZ/completion ]] && fpath=($OMZ/completions $fpath)
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d $OMZ ]]; then
|
for config_file ($ZSH/lib/*.zsh(N))
|
||||||
for config_file ($OMZ/*.zsh(N))
|
source $config_file
|
||||||
source $config_file
|
|
||||||
fi
|
|
||||||
|
|
||||||
for plugin ($plugins)
|
if [[ -d $OMZ ]]; then
|
||||||
fpath=($ZSH/plugins/$plugin $fpath)
|
for config_file ($OMZ/*.zsh(N))
|
||||||
|
source $config_file
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -d $OMZ ]]; then
|
for plugin ($plugins)
|
||||||
if [[ -d $OMZ/plugins ]]; then
|
fpath=($ZSH/plugins/$plugin $fpath)
|
||||||
for plugin ($plugins)
|
|
||||||
fpath=($OMZ/plugins/$plugin $fpath)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Load and run compinit
|
if [[ -d $OMZ ]]; then
|
||||||
autoload -U compinit
|
if [[ -d $OMZ/plugins ]]; then
|
||||||
compinit -i
|
for plugin ($plugins)
|
||||||
|
fpath=($OMZ/plugins/$plugin $fpath)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# load plugins
|
# Load and run compinit
|
||||||
for plugin ($plugins); do
|
autoload -U compinit
|
||||||
if [[ -f $OMZ/plugins/$plugin/$plugin.plugin.zsh ]]; then
|
compinit -i
|
||||||
source $OMZ/plugins/$plugin/$plugin.plugin.zsh
|
|
||||||
elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then
|
|
||||||
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
local theme
|
# load plugins
|
||||||
zstyle -a :omz:style theme theme
|
for plugin ($plugins); do
|
||||||
set_theme $theme
|
if [[ -f $OMZ/plugins/$plugin/$plugin.plugin.zsh ]]; then
|
||||||
|
source $OMZ/plugins/$plugin/$plugin.plugin.zsh
|
||||||
|
elif [[ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]]; then
|
||||||
|
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
local theme
|
||||||
|
zstyle -a :omz:style theme theme
|
||||||
|
set_theme $theme
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$0: invalid command $1" 2>&1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# vi: ft=zsh
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
# Check /etc/zsh/zshrc for system defaults.
|
# Check /etc/zsh/zshrc for system defaults.
|
||||||
|
|
||||||
|
autoload omz
|
||||||
|
|
||||||
zstyle :omz:style theme "arch-blue"
|
zstyle :omz:style theme "arch-blue"
|
||||||
|
|
||||||
plugins=(archlinux sprunge git github)
|
plugins=(archlinux sprunge git github)
|
||||||
|
|
||||||
omz_init
|
omz init
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue