Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
531c41cd
Commit
531c41cd
authored
Dec 01, 2015
by
LE Manh Cuong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow loading themes from predefined list
parent
f558a460
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
oh-my-zsh.sh
oh-my-zsh.sh
+5
-1
zshrc.zsh-template
templates/zshrc.zsh-template
+6
-0
No files found.
oh-my-zsh.sh
View file @
531c41cd
...
@@ -94,7 +94,11 @@ unset config_file
...
@@ -94,7 +94,11 @@ unset config_file
# Load the theme
# Load the theme
if
[
"
$ZSH_THEME
"
=
"random"
]
;
then
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
=
${#
themes
[@]
}
((
N
=(
RANDOM%N
)
+1
))
((
N
=(
RANDOM%N
)
+1
))
RANDOM_THEME
=
${
themes
[
$N
]
}
RANDOM_THEME
=
${
themes
[
$N
]
}
...
...
templates/zshrc.zsh-template
View file @
531c41cd
...
@@ -7,6 +7,12 @@ export ZSH=$HOME/.oh-my-zsh
...
@@ -7,6 +7,12 @@ export ZSH=$HOME/.oh-my-zsh
# time that oh-my-zsh is loaded.
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
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.
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# 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