Not for normies
| 1 | #!/usr/bin/env zsh |
| 2 | # ------------------------------------------------------------------------------ |
| 3 | # FILE: emotty.zsh-theme |
| 4 | # DESCRIPTION: A varying emoji based theme |
| 5 | # AUTHOR: Alexis Hildebrandt (afh[at]surryhill.net) |
| 6 | # VERSION: 1.0.0 |
| 7 | # DEPENDS: emotty plugin |
| 8 | # RECOMMENDS: Hasklig font |
| 9 | # |
| 10 | # This theme shows a different emoji for each tty at the main prompt. |
| 11 | # |
| 12 | # There are pre-defined different emoji sets to choose from, e.g.: |
| 13 | # emoji, stellar, floral, zodiac, love (see emotty plugin). |
| 14 | # |
| 15 | # To choose a different emotty set than the default (emoji) |
| 16 | # % export emotty_set=nature |
| 17 | # |
| 18 | # For the superuser (root) this theme shows a designated indicator |
| 19 | # and switches the foreground color to red |
| 20 | # (see root_prompt variable, default: skull). |
| 21 | # But you are using sudo (8) instead of designated a root shell, right‽ |
| 22 | # |
| 23 | # When logged in via SSH the main prompt also shows the user- and hostname. |
| 24 | # |
| 25 | # The exit status of the last failed command is displayed in the window title |
| 26 | # along with an indicator (see warn_glyph variable, default: collision symbol). |
| 27 | # To clear it just run: $NULL, true or : |
| 28 | # |
| 29 | # The right prompt shows the current working directory (3 levels up) in cyan. |
| 30 | # |
| 31 | # When in a git repository the main prompt shows the current branch name |
| 32 | # with a branch indicator in yellow |
| 33 | # (see vcs_branch_glyph variable, default: Hasklig branch glyph). |
| 34 | # |
| 35 | # If there are modified files the prompt switches to red and shows an unstaged |
| 36 | # indicator (see vcs_unstaged_glyph variable, default: circled letter M). |
| 37 | # |
| 38 | # If there are staged files the prompt switches to green and shows an staged |
| 39 | # indicator (see vcs_staged_glyph variable, default: high voltage sign). |
| 40 | # |
| 41 | # In a git repository the right prompt shows the repository name in bold and |
| 42 | # prepends the current working directory subpath within the repository. |
| 43 | # |
| 44 | # When git currently performs an action such as merge or rebase, the action is |
| 45 | # displayed in red instead of the branch name and a special action indicator |
| 46 | # is shown (see vcs_action_glyph variable, default: chevron). |
| 47 | # ------------------------------------------------------------------------------ |
| 48 | |
| 49 | || { |
| 50 | |
| 51 | |
| 52 | } |
| 53 | |
| 54 | || { |
| 55 | |
| 56 | |
| 57 | } |
| 58 | |
| 59 | user_prompt="" |
| 60 | root_prompt="[skull]" |
| 61 | warn_prompt="[collision_symbol]" |
| 62 | |
| 63 | vcs_unstaged_glyph="%{[circled_latin_capital_letter_m][emoji_style] %2G%}" |
| 64 | vcs_staged_glyph="%{[high_voltage_sign]%2G%}" |
| 65 | vcs_branch_glyph=$'\Ue0a0' # |
| 66 | vcs_action_glyph=$'\U276f' # ❯ |
| 67 | |
| 68 | red="[001]" |
| 69 | yellow="[003]" |
| 70 | green="[002]" |
| 71 | cyan="[014]" |
| 72 | |
| 73 | prompt_glyph="%{%(#..) %2G%}" |
| 74 | |
| 75 | # Uncomment the next line if you also like to see the warn_prompt in the prompt on the right. |
| 76 | #last_command_failed="%(?.. %F{red}%1{${warn_prompt} %1G%}%?%f)" |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | # Workaround for zsh 5.2 release (kudos to @timothybasanov) |
| 82 | |
| 83 | functions[VCS_INFO_nvcsformats]= |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | # %(K|F){color} set (back|fore)ground color |
| 95 | # %(k|f) reset (back|fore)ground color |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | red_if_root="%(!.%F{red}.)" |
| 102 | sshuser_on_host="" |
| 103 | |
| 104 | PROMPT='${sshuser_on_host}${vcs_info_msg_0_}${red_if_root} ' |
| 105 | RPROMPT='${cyan}${vcs_info_msg_1_##.|}${vcs_info_msg_2_}%f${last_command_failed}' |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | # vim:ft=zsh ts=2 sw=2 sts=2 |