summaryrefslogtreecommitdiff
path: root/plugins/themes/themes.plugin.zsh
blob: ac4ccc980297d7f2878f453ac082c342db8aa673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function theme
{
    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"
    else
        source "$ZSH/themes/$1.zsh-theme"
    fi
}

function lstheme
{
    # 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)
}