Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
adcb5c5e
Unverified
Commit
adcb5c5e
authored
Jun 13, 2021
by
Bartek Pacia
Committed by
GitHub
Jun 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style(mlh): update the official theme of Major League Hacking (#9971)
* allow for customization of RPROMPT (exit code and timestamp) * improve code and comments
parent
5152d381
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
22 deletions
+33
-22
mlh.zsh-theme
themes/mlh.zsh-theme
+33
-22
No files found.
themes/mlh.zsh-theme
View file @
adcb5c5e
# The Official Theme of
## ## ## ## ##
### ### ## ## ##
#### #### ## ## ##
## ### ## ## #########
## ## ## ## ##
## ## ## ## ##
## ## ######## ## ##
# The Official Theme of Major League Hacking
## ## ## ## ##
### ### ## ## ##
#### #### ## ## ##
## ### ## ## #########
## ## ## ## ##
## ## ## ## ##
## ## ######## ## ##
# # # # # # # # # # # # # # # # # #
# # # Feel free to customize! # # #
...
...
@@ -13,11 +14,17 @@
# To easily discover colors and their codes, type `spectrum_ls` in the terminal
# enable or disable particular elements
PRINT_EXIT_CODE=true
PRINT_TIME=true
# symbols
AT_SYMBOL=" @ "
IN_SYMBOL=" in "
ON_SYMBOL=" on "
SYMBOL="$"
S
HELL_S
YMBOL="$"
# colors
USER_COLOR="%F{001}"
DEVICE_COLOR="%F{033}"
DIR_COLOR="%F{220}"
...
...
@@ -25,35 +32,39 @@ BRANCH_COLOR="%F{001}"
TIME_COLOR="%F{033}"
username() {
echo "$USER_COLOR%n%f"
echo "$USER_COLOR%n%f"
}
#
Returns device name
#
Prints device name
device() {
echo "$DEVICE_COLOR%m%f"
echo "$DEVICE_COLOR%m%f"
}
#
T
he current directory
#
Prints t
he current directory
directory() {
echo "$DIR_COLOR%1~%f"
echo "$DIR_COLOR%1~%f"
}
#
Current time with milliseconds
#
Prints current time
current_time() {
echo "$TIME_COLOR%*%f"
if [ "$PRINT_TIME" = true ]; then
echo " $TIME_COLOR%*%f"
fi
}
# Return status of the last command
return_status() {
echo "%(?..%F{001}out %?)%f"
# Prints exit code of the last executed command
exit_code() {
if [ "$PRINT_EXIT_CODE" = true ]; then
echo "%(?..%F{001}exit %?)%f"
fi
}
# Set
the
git_prompt_info text
# Set git_prompt_info text
ZSH_THEME_GIT_PROMPT_PREFIX="${ON_SYMBOL}${BRANCH_COLOR}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
ZSH_THEME_GIT_PROMPT_DIRTY=""
ZSH_THEME_GIT_PROMPT_CLEAN=""
# %B and %b make the text bold
PROMPT='%b$(username)$AT_SYMBOL$(device)$IN_SYMBOL$(directory)$(git_prompt_info)%b $SYMBOL '
RPROMPT="$(
return_status)
$(current_time)"
PROMPT='%b$(username)$AT_SYMBOL$(device)$IN_SYMBOL$(directory)$(git_prompt_info)%b $S
HELL_S
YMBOL '
RPROMPT="$(
exit_code)
$(current_time)"
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