mlh.zsh-theme 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # The Official Theme of Major League Hacking
  2. ## ## ## ## ##
  3. ### ### ## ## ##
  4. #### #### ## ## ##
  5. ## ### ## ## #########
  6. ## ## ## ## ##
  7. ## ## ## ## ##
  8. ## ## ######## ## ##
  9. # # # # # # # # # # # # # # # # # #
  10. # # # Feel free to customize! # # #
  11. # # # # # # # # # # # # # # # # # #
  12. # To easily discover colors and their codes, type `spectrum_ls` in the terminal
  13. # enable or disable particular elements
  14. PRINT_EXIT_CODE=true
  15. PRINT_TIME=true
  16. # symbols
  17. AT_SYMBOL=" @ "
  18. IN_SYMBOL=" in "
  19. ON_SYMBOL=" on "
  20. SHELL_SYMBOL="$"
  21. # colors
  22. USER_COLOR="%F{001}"
  23. DEVICE_COLOR="%F{033}"
  24. DIR_COLOR="%F{220}"
  25. BRANCH_COLOR="%F{001}"
  26. TIME_COLOR="%F{033}"
  27. username() {
  28. echo "$USER_COLOR%n%f"
  29. }
  30. # Prints device name
  31. device() {
  32. echo "$DEVICE_COLOR%m%f"
  33. }
  34. # Prints the current directory
  35. directory() {
  36. echo "$DIR_COLOR%1~%f"
  37. }
  38. # Prints current time
  39. current_time() {
  40. if [ "$PRINT_TIME" = true ]; then
  41. echo " $TIME_COLOR%*%f"
  42. fi
  43. }
  44. # Prints exit code of the last executed command
  45. exit_code() {
  46. if [ "$PRINT_EXIT_CODE" = true ]; then
  47. echo "%(?..%F{001}exit %?)%f"
  48. fi
  49. }
  50. # Set git_prompt_info text
  51. ZSH_THEME_GIT_PROMPT_PREFIX="${ON_SYMBOL}${BRANCH_COLOR}"
  52. ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
  53. ZSH_THEME_GIT_PROMPT_DIRTY=""
  54. ZSH_THEME_GIT_PROMPT_CLEAN=""
  55. # %B and %b make the text bold
  56. PROMPT='%b$(username)$AT_SYMBOL$(device)$IN_SYMBOL$(directory)$(git_prompt_info)%b $SHELL_SYMBOL '
  57. RPROMPT="$(exit_code)$(current_time)"