Last active
March 13, 2026 12:05
-
-
Save ryx/f83e6e83c0c44b11e6ab8fb6355472a1 to your computer and use it in GitHub Desktop.
Nice and stylish ZSH prompt without requiring any special font. Works best in ghostty (standard MacOS Terminal doesn't render the triangle shape in full height).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Autoload zsh's `add-zsh-hook` and `vcs_info` functions | |
| # (-U autoload w/o substition, -z use zsh style) | |
| autoload -Uz add-zsh-hook vcs_info | |
| # Set prompt substitution so we can use the vcs_info_message variable | |
| setopt prompt_subst | |
| # Run the `vcs_info` hook to grab git info before displaying the prompt | |
| add-zsh-hook precmd vcs_info | |
| # Style the vcs_info message | |
| zstyle ':vcs_info:*' enable git | |
| zstyle ':vcs_info:git*' formats '%b%u%c' | |
| # Format when the repo is in an action (merge, rebase, etc) | |
| zstyle ':vcs_info:git*' actionformats '%F{14}⏱ %*%f' | |
| zstyle ':vcs_info:git*' unstagedstr '*' | |
| zstyle ':vcs_info:git*' stagedstr '+' | |
| # This enables %u and %c (unstaged/staged changes) to work, | |
| # but can be slow on large repos | |
| zstyle ':vcs_info:*:*' check-for-changes true | |
| # Set left prompt to "exitcode username \ path \ [branch]" | |
| PROMPT='%K{242}%F{black} %(?.%F{77}⠦.%F{red}⠦)%f %n %f%k%K{238}%F{242}◣%f %2~ %k%K%{$reset_color%}%F{238}◣%f %F{8}$vcs_info_msg_0_%f %k%F{black}◣%f ' | |
| # Set the right prompt to the current date | |
| RPROMPT='%F{8}$(date +%H:%M:%S)%f' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment