mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Cleaned up /lib/, removed trailing white space everywhere.
This commit is contained in:
parent
db6c172e9f
commit
1e9b718af1
50 changed files with 332 additions and 298 deletions
50
oh-my-zsh.sh
50
oh-my-zsh.sh
|
|
@ -1,45 +1,45 @@
|
|||
# Initializes Oh My Zsh
|
||||
# Initializes OH MY ZSH.
|
||||
|
||||
# Disable colors on dumb terminals
|
||||
if [ "$TERM" = "dumb" ]; then
|
||||
DISABLE_COLOR="true"
|
||||
# Disable color in dumb terminals.
|
||||
if [[ "$TERM" == 'dumb' ]]; then
|
||||
DISABLE_COLOR='true'
|
||||
fi
|
||||
|
||||
# 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) source $config_file
|
||||
# Load all files in $ZSH/oh-my-zsh/lib/ that end in .zsh.
|
||||
for config_file in $ZSH/lib/*.zsh; do
|
||||
source "$config_file"
|
||||
done
|
||||
|
||||
# Add all defined plugins to fpath
|
||||
# Add all defined plugins to fpath.
|
||||
plugin=${plugin:=()}
|
||||
for plugin ($plugins) fpath=($ZSH/plugins/$plugin $fpath)
|
||||
for plugin in $plugins; do
|
||||
fpath=($ZSH/plugins/$plugin $fpath)
|
||||
done
|
||||
|
||||
# Load and run compinit
|
||||
# Load and run compinit.
|
||||
autoload -U compinit
|
||||
compinit -i
|
||||
|
||||
# Load all of the plugins that were defined in ~/.zshrc
|
||||
for plugin ($plugins); do
|
||||
if [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
|
||||
source $ZSH/plugins/$plugin/$plugin.plugin.zsh
|
||||
# Load all plugins defined in ~/.zshrc.
|
||||
for plugin in $plugins; do
|
||||
if [[ -f "$ZSH/plugins/$plugin/$plugin.plugin.zsh" ]]; then
|
||||
source "$ZSH/plugins/$plugin/$plugin.plugin.zsh"
|
||||
fi
|
||||
done
|
||||
|
||||
# Load the theme
|
||||
# Check for updates on initial load...
|
||||
if [ "$ZSH_THEME" = "random" ]
|
||||
then
|
||||
themes=($ZSH/themes/*zsh-theme)
|
||||
N=${#themes[@]}
|
||||
((N=(RANDOM%N)+1))
|
||||
RANDOM_THEME=${themes[$N]}
|
||||
source "$RANDOM_THEME"
|
||||
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
|
||||
# Load the theme.
|
||||
if [[ "$ZSH_THEME" == "random" ]]; then
|
||||
themes=($ZSH/themes/*.zsh-theme)
|
||||
theme_index=${#themes[@]}
|
||||
(( theme_index=((RANDOM % theme_index) + 1) ))
|
||||
random_theme="${themes[$theme_index]}"
|
||||
source "$random_theme"
|
||||
else
|
||||
source "$ZSH/themes/$ZSH_THEME.zsh-theme"
|
||||
fi
|
||||
|
||||
# Compile zcompdump, if modified, to increase startup speed.
|
||||
if [ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" -o ! -e "$HOME/.zcompdump.zwc" ]; then
|
||||
if [[ "$HOME/.zcompdump" -nt "$HOME/.zcompdump.zwc" ]] || [[ ! -e "$HOME/.zcompdump.zwc" ]]; then
|
||||
zcompile "$HOME/.zcompdump"
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue