Makes the theme plugin sane

A couple of improvements for the theme plugin

* Custom themes are looked for in `$ZSH_CUSTOM/themes`
* `lstheme` function doesn't cd to the directory anymore
This commit is contained in:
Joe H. Rahme 2015-11-12 15:18:38 +01:00
commit 53c08153df

View file

@ -8,9 +8,9 @@ function theme
source "$RANDOM_THEME" source "$RANDOM_THEME"
echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else else
if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ] if [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]
then then
source "$ZSH_CUSTOM/$1.zsh-theme" source "$ZSH_CUSTOM/themes/$1.zsh-theme"
else else
source "$ZSH/themes/$1.zsh-theme" source "$ZSH/themes/$1.zsh-theme"
fi fi
@ -19,6 +19,5 @@ function theme
function lstheme function lstheme
{ {
cd $ZSH/themes find "$ZSH"/themes "$ZSH_CUSTOM"/themes -name '*.zsh-theme' | sort -u | sed 's:.*/\(.*\)\.zsh-theme:\1:'
ls *zsh-theme | sed 's,\.zsh-theme$,,'
} }