mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-13 03:12:21 +01:00
plugins/theme: change to 2-space indenting and detabify (per https://github.com/robbyrussell/oh-my-zsh/wiki/Coding-style-guide#general)
This commit is contained in:
parent
5ee54032da
commit
d7c9e16f03
1 changed files with 15 additions and 15 deletions
|
|
@ -1,24 +1,24 @@
|
||||||
function theme
|
function theme
|
||||||
{
|
{
|
||||||
if [ -z "$1" ] || [ "$1" = "random" ]; then
|
if [ -z "$1" ] || [ "$1" = "random" ]; then
|
||||||
themes=($ZSH/themes/*zsh-theme)
|
themes=($ZSH/themes/*zsh-theme)
|
||||||
N=${#themes[@]}
|
N=${#themes[@]}
|
||||||
((N=(RANDOM%N)+1))
|
((N=(RANDOM%N)+1))
|
||||||
RANDOM_THEME=${themes[$N]}
|
RANDOM_THEME=${themes[$N]}
|
||||||
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
|
||||||
|
if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ]
|
||||||
|
then
|
||||||
|
source "$ZSH_CUSTOM/$1.zsh-theme"
|
||||||
else
|
else
|
||||||
if [ -f "$ZSH_CUSTOM/$1.zsh-theme" ]
|
source "$ZSH/themes/$1.zsh-theme"
|
||||||
then
|
|
||||||
source "$ZSH_CUSTOM/$1.zsh-theme"
|
|
||||||
else
|
|
||||||
source "$ZSH/themes/$1.zsh-theme"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function lstheme
|
function lstheme
|
||||||
{
|
{
|
||||||
cd $ZSH/themes
|
cd $ZSH/themes
|
||||||
ls *zsh-theme | sed 's,\.zsh-theme$,,'
|
ls *zsh-theme | sed 's,\.zsh-theme$,,'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue