Skip to content

Instantly share code, notes, and snippets.

@ryx
Last active March 13, 2026 12:05
Show Gist options
  • Select an option

  • Save ryx/f83e6e83c0c44b11e6ab8fb6355472a1 to your computer and use it in GitHub Desktop.

Select an option

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).
# 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