Allow user to blacklist themes from random selector.

This commit is contained in:
Fran Garcia 2015-03-19 21:33:49 +00:00
commit 372a4d0930
2 changed files with 7 additions and 1 deletions

View file

@ -81,6 +81,10 @@ unset config_file
# Load the theme
if [ "$ZSH_THEME" = "random" ]; then
themes=($ZSH/themes/*zsh-theme)
for theme ($ZSH_BLACKLISTED_THEMES) do
themes=(${themes:#$ZSH/themes/${theme}.zsh-theme})
done
N=${#themes[@]}
((N=(RANDOM%N)+1))
RANDOM_THEME=${themes[$N]}

View file

@ -4,8 +4,10 @@ export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# time that oh-my-zsh is loaded, except for themes included in
# ZSH_BLACKLISTED_THEMES
ZSH_THEME="robbyrussell"
#ZSH_BLACKLISTED_THEMES=()
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"