Skip to content

Instantly share code, notes, and snippets.

@Shinpeim
Created August 16, 2016 06:21
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 Shinpeim/eb1ca8d55ae9793e20a13f5bf88630d0 to your computer and use it in GitHub Desktop.
Save Shinpeim/eb1ca8d55ae9793e20a13f5bf88630d0 to your computer and use it in GitHub Desktop.
autoload -Uz vcs_info
zstyle ':vcs_info:*' formats '[%r - %b](%s)'
zstyle ':vcs_info:*' actionformats '(%s)-[%r - %b|%a]'
precmd () {
psvar=()
LANG=en_US.UTF-8 vcs_info
[[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_ "
psvar[2]=$(date +'%m/%d %H:%M:%S');
}
PS_OK=$'\n''%1(v|%F{green}%1v%f|)%F{green}[CURRENT=%~] %F{white}[%2v]'$'\n%F{white} %F{green}✔ %f'
PS_NG=$'\n''%1(v|%F{red}%1v%f|)%F{red}[CURRENT=%~] %F{white}[%2v]'$'\n%F{white} %F{red}✘ %f'
PROMPT="%0(?|${PS_OK}|${PS_NG})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment