diff options
author | Tuowen Zhao <ztuowen@gmail.com> | 2021-07-11 19:58:51 -0600 |
---|---|---|
committer | Tuowen Zhao <ztuowen@gmail.com> | 2021-07-11 19:58:51 -0600 |
commit | 617ed3bd9f3d9519fe2354941f3dbf15b0c712ee (patch) | |
tree | caf617b35d3f5f7b5786483eedfcda9361dca108 /themes/mlh.zsh-theme | |
parent | 0144641b7d8e4e6ff6ce153039b5a827f5347904 (diff) | |
parent | 36f444ed7325720ec05f182781ec7d6c9a4d675c (diff) | |
download | zsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.tar.gz zsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.tar.bz2 zsh-617ed3bd9f3d9519fe2354941f3dbf15b0c712ee.zip |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'themes/mlh.zsh-theme')
-rw-r--r-- | themes/mlh.zsh-theme | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/themes/mlh.zsh-theme b/themes/mlh.zsh-theme index a21a546bc..33f238ed9 100644 --- a/themes/mlh.zsh-theme +++ b/themes/mlh.zsh-theme @@ -1,11 +1,12 @@ -# 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="$" +SHELL_SYMBOL="$" +# 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" } -# The current directory +# Prints the 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 $SHELL_SYMBOL ' +RPROMPT="$(exit_code)$(current_time)" |