From 53c08153df51da8255296294a02dabc1dccee968 Mon Sep 17 00:00:00 2001 From: "Joe H. Rahme" Date: Thu, 12 Nov 2015 15:18:38 +0100 Subject: [PATCH] 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 --- plugins/themes/themes.plugin.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/themes/themes.plugin.zsh b/plugins/themes/themes.plugin.zsh index 7519b0253..1681f6845 100644 --- a/plugins/themes/themes.plugin.zsh +++ b/plugins/themes/themes.plugin.zsh @@ -8,9 +8,9 @@ function theme source "$RANDOM_THEME" echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..." else - if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ] + if [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ] then - source "$ZSH_CUSTOM/$1.zsh-theme" + source "$ZSH_CUSTOM/themes/$1.zsh-theme" else source "$ZSH/themes/$1.zsh-theme" fi @@ -19,6 +19,5 @@ function theme function lstheme { - cd $ZSH/themes - ls *zsh-theme | sed 's,\.zsh-theme$,,' + find "$ZSH"/themes "$ZSH_CUSTOM"/themes -name '*.zsh-theme' | sort -u | sed 's:.*/\(.*\)\.zsh-theme:\1:' }