Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
531c41cd
"frontend/git@web.lueluesay.top:chenxi/sub2api.git" did not exist on "679b21a86c27ae1b008372f443d24057f557039a"
Commit
531c41cd
authored
Dec 01, 2015
by
LE Manh Cuong
Browse files
Allow loading themes from predefined list
parent
f558a460
Changes
2
Hide whitespace changes
Inline
Side-by-side
oh-my-zsh.sh
View file @
531c41cd
...
...
@@ -94,7 +94,11 @@ unset config_file
# Load the theme
if
[
"
$ZSH_THEME
"
=
"random"
]
;
then
themes
=(
$ZSH
/themes/
*
zsh-theme
)
if
[
"
${
(t)ZSH_THEME_RANDOM_CANDICATES
}
"
=
"array"
]
&&
[
"
${#
ZSH_THEME_RANDOM_CANDICATES
[@]
}
"
-gt
0
]
;
then
themes
=(
$ZSH
/themes/
${
^ZSH_THEME_RANDOM_CANDICATES
}
.zsh-theme
)
else
themes
=(
$ZSH
/themes/
*
zsh-theme
)
fi
N
=
${#
themes
[@]
}
((
N
=(
RANDOM%N
)
+1
))
RANDOM_THEME
=
${
themes
[
$N
]
}
...
...
templates/zshrc.zsh-template
View file @
531c41cd
...
...
@@ -7,6 +7,12 @@ export ZSH=$HOME/.oh-my-zsh
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Set list of themes to load
# Setting this variable when ZSH_THEME=random
# cause zsh load theme from this variable instead of
# looking in ~/.oh-my-zsh/themes/
# ZSH_THEME_RANDOM_CANDICATES=()
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment