Skip to content

Instantly share code, notes, and snippets.

@Lytol
Last active September 16, 2015 05:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lytol/f1e5690a9e39e7e31d04 to your computer and use it in GitHub Desktop.
Save Lytol/f1e5690a9e39e7e31d04 to your computer and use it in GitHub Desktop.
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{green}●%f'
zstyle ':vcs_info:*' unstagedstr '%F{red}●%f'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' formats '[%F{027}%b%f%c%u] '
zstyle ':vcs_info:*' enable git
theme_precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
zstyle ':vcs_info:*' formats '[%F{027}%b%f%c%u] '
} else {
zstyle ':vcs_info:*' formats '[%F{027}%b%f%F{red}●%f] '
}
vcs_info
}
setopt prompt_subst
PROMPT='%F{208}λ%f %B%~/%b ${vcs_info_msg_0_}» '
autoload -U add-zsh-hook
add-zsh-hook precmd theme_precmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment