Browse code

global zsh config

fox authored on 24/07/2011 at 18:51:27
Showing 1 changed files
... ...
@@ -20,18 +20,19 @@ function noyes() {
20 20
 
21 21
 function theme_preview() {
22 22
     THEME=$1
23
+    THEME_NAME=`echo $THEME | sed s/\.zsh-theme//`
23 24
     export ZDOTDIR="$(mktemp -d tmp.zshXXXX)"
24 25
 
25 26
 cat <<-EOF >"$ZDOTDIR/.zshrc"
26
-    source ~/.zshrc
27
-    source "$THEMES_DIR/$THEME"
27
+    ZSH_THEME="$THEME_NAME"
28
+    source $ZSH/oh-my-zsh.sh
28 29
 EOF
29 30
     zsh
30 31
     rm -rf "$ZDOTDIR"
31 32
 
32 33
     echo
33 34
     noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \
34
-          echo $THEME >> $FAVLIST
35
+          echo $THEME_NAME >> $FAVLIST
35 36
     echo
36 37
 }
37 38