Skip to content

Instantly share code, notes, and snippets.

@dmytro
Created November 27, 2012 05:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmytro/4152569 to your computer and use it in GitHub Desktop.
Save dmytro/4152569 to your computer and use it in GitHub Desktop.
Prompt for ZSH and Git
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git
precmd() {
vcs_info
}
setopt prompt_subst
zstyle ':vcs_info:git:*' check-for-changes true
zstyle ':vcs_info:*' formats "%f[%%n@%%m %1~] $ " "%f%a %F{3}%m%u%c %f%b:%r/%S"
zstyle ':vcs_info:*' nvcsformats "%f[%n@%m %1~]$ " ""
zstyle ':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f '
PROMPT='${vcs_info_msg_0_}'
RPROMPT='${vcs_info_msg_1_}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment