themes.plugin.zsh 572 Bytes
Newer Older
Roey Darwish Dror's avatar
Roey Darwish Dror committed
1
2
function theme
{
3
4
5
6
7
8
9
10
11
12
    if [ -z "$1" ]; then
        1="random"
    fi

    if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ]
    then
        source "$ZSH_CUSTOM/$1.zsh-theme"
    elif [ -f "$ZSH_CUSTOM/themes/$1.zsh-theme" ]
    then
        source "$ZSH_CUSTOM/themes/$1.zsh-theme"
Roey Darwish Dror's avatar
Roey Darwish Dror committed
13
    else
14
        source "$ZSH/themes/$1.zsh-theme"
Roey Darwish Dror's avatar
Roey Darwish Dror committed
15
16
17
18
19
    fi
}

function lstheme
{
20
21
22
23
    # Resources:
    # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Modifiers
    # http://zsh.sourceforge.net/Doc/Release/Expansion.html#Glob-Qualifiers
    print -l {$ZSH,$ZSH_CUSTOM}/themes/*.zsh-theme(N:t:r)
Roey Darwish Dror's avatar
Roey Darwish Dror committed
24
}