mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Use zstyle instead of variables for configuration.
This commit is contained in:
parent
60f39d8d91
commit
f0499b76c3
13 changed files with 156 additions and 103 deletions
16
init.zsh
16
init.zsh
|
|
@ -3,15 +3,19 @@
|
|||
# Check for the minimum supported version.
|
||||
min_zsh_version=4.3.9
|
||||
if ! autoload -Uz is-at-least || ! is-at-least "$min_zsh_version"; then
|
||||
print "oh-my-zsh: The minimum supported Zsh version is $min_zsh_version."
|
||||
print "omz: The minimum supported Zsh version is $min_zsh_version."
|
||||
fi
|
||||
unset min_zsh_version
|
||||
|
||||
# Disable color in dumb terminals.
|
||||
# Disable color and theme in dumb terminals.
|
||||
if [[ "$TERM" == 'dumb' ]]; then
|
||||
COLOR='false'
|
||||
zstyle ':omz:*:*' color 'no'
|
||||
zstyle ':omz:prompt' theme 'off'
|
||||
fi
|
||||
|
||||
# Get enabled plugins.
|
||||
zstyle -a ':omz:load' plugin 'plugins'
|
||||
|
||||
# Add functions to fpath.
|
||||
fpath=(
|
||||
${0:h}/themes/*(/FN)
|
||||
|
|
@ -43,6 +47,7 @@ autoload -Uz zmv
|
|||
|
||||
# Source plugins defined in ~/.zshrc.
|
||||
for plugin in "$plugins[@]"; do
|
||||
zstyle ":omz:plugin:$plugin" enable 'yes'
|
||||
if [[ -f "${0:h}/plugins/$plugin/init.zsh" ]]; then
|
||||
source "${0:h}/plugins/$plugin/init.zsh"
|
||||
fi
|
||||
|
|
@ -66,6 +71,11 @@ fi
|
|||
# Load and run the prompt theming system.
|
||||
autoload -Uz promptinit && promptinit
|
||||
|
||||
# Load the prompt theme.
|
||||
zstyle -a ':omz:prompt' theme 'prompt_argv'
|
||||
prompt "$prompt_argv[@]"
|
||||
unset prompt_argv
|
||||
|
||||
# Compile zcompdump, if modified, to increase startup speed.
|
||||
if [[ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" ]] || [[ ! -f "$HOME/.zcompdump.zwc" ]]; then
|
||||
zcompile "$HOME/.zcompdump"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue