Swapped out ZSH_THEME for two functions, set_theme and random_theme. At the moment I dropped ZSH_THEME variable too. Auto completion to come. Function makes it easier to change themes on-the-fly.

This commit is contained in:
Simon Gomizelj 2011-11-28 09:24:49 -05:00
commit a812654cbe

View file

@ -40,19 +40,12 @@ done
# Load all of your custom configurations from custom/ # Load all of your custom configurations from custom/
for config_file ($ZSH_CUSTOM/*.zsh) source $config_file for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
# Load the theme set_theme() {
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..."
else
if [ ! "$ZSH_THEME" = "" ]
then
source "$ZSH/themes/$ZSH_THEME.zsh-theme" source "$ZSH/themes/$ZSH_THEME.zsh-theme"
fi }
fi
random_theme() {
local themes
themes=($ZSH/themes/*zsh-theme)
source "$themes[$RANDOM%$#themes+1]"
}