Skip to content

Instantly share code, notes, and snippets.

@terrisgit
Created June 22, 2023 14:50
Show Gist options
  • Select an option

  • Save terrisgit/95c179678ba3e73801f4b95ce28c0763 to your computer and use it in GitHub Desktop.

Select an option

Save terrisgit/95c179678ba3e73801f4b95ce28c0763 to your computer and use it in GitHub Desktop.
Git Branch in Prompt
# Prompt example: ~/dir [repo-name] main () %
autoload -Uz vcs_info
zstyle ':vcs_info:git*' formats "[%r] %b (%a) %m%u%c "
precmd() { vcs_info }
setopt prompt_subst
PROMPT='${PWD/#$HOME/~} ${vcs_info_msg_0_}%# '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment