Skip to content

Instantly share code, notes, and snippets.

@guehara
Created October 20, 2011 16:58
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 guehara/1301654 to your computer and use it in GitHub Desktop.
Save guehara/1301654 to your computer and use it in GitHub Desktop.
zsh prompt with vcs_info
autoload -Uz vcs_info
zstyle ':vcs_info:*' formats '(%s)[%b] '
zstyle ':vcs_info:*' actionformats '(%s)[%b|%a] '
precmd () {
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
}
# prompt
PROMPT="[%n@${HOST%%.*} %F{green}%~%f] "
PROMPT2="%_%% "
SPROMPT="%r is correct? [n,y,a,e]: "
RPROMPT="%1(v|%F{yellow}%1v%f|)%T"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment