2 : ${1:=random} # Use random theme if none provided
4 if [[ -f "$ZSH_CUSTOM/$1.zsh-theme" ]]; then
5 source "$ZSH_CUSTOM/$1.zsh-theme"
6 elif [[ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]]; then
7 source "$ZSH_CUSTOM/themes/$1.zsh-theme"
8 elif [[ -f "$ZSH/themes/$1.zsh-theme" ]]; then
9 source "$ZSH/themes/$1.zsh-theme"
11 echo "$0: Theme '$1' not found"
17 _arguments "1: :($(lstheme))"
24 # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers
25 # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers
27 # Show themes inside $ZSH_CUSTOM (in any subfolder)
28 # Strip $ZSH_CUSTOM/themes/ and $ZSH_CUSTOM/ from the name, so that it matches
29 # the value that should be written in $ZSH_THEME to load the theme.
30 print -l "$ZSH_CUSTOM"/**/*.zsh-theme(.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::)
32 # Show themes inside $ZSH, stripping the head of the path.
33 print -l "$ZSH"/themes/*.zsh-theme(.N:t:r)
34 } | sort -u | fmt -w $COLUMNS