|
|
@ -7,7 +7,7 @@ |
|
|
|
# |
|
|
|
# |
|
|
|
|
|
|
|
|
|
|
|
function +vi-git-status() { |
|
|
|
function +vi-git-status() { |
|
|
|
# Untracked files. |
|
|
|
# Check for untracked files or updated submodules since vcs_info does not. |
|
|
|
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then |
|
|
|
if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then |
|
|
|
hook_com[unstaged]='%F{red}●%f' |
|
|
|
hook_com[unstaged]='%F{red}●%f' |
|
|
|
fi |
|
|
|
fi |
|
|
@ -22,11 +22,14 @@ function prompt_minimal_setup { |
|
|
|
unsetopt XTRACE KSH_ARRAYS |
|
|
|
unsetopt XTRACE KSH_ARRAYS |
|
|
|
prompt_opts=(cr percent subst) |
|
|
|
prompt_opts=(cr percent subst) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Load required functions. |
|
|
|
autoload -Uz add-zsh-hook |
|
|
|
autoload -Uz add-zsh-hook |
|
|
|
autoload -Uz vcs_info |
|
|
|
autoload -Uz vcs_info |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add hook for calling vcs_info before each command. |
|
|
|
add-zsh-hook precmd prompt_minimal_precmd |
|
|
|
add-zsh-hook precmd prompt_minimal_precmd |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Set vcs_info parameters. |
|
|
|
zstyle ':vcs_info:*' enable bzr git hg svn |
|
|
|
zstyle ':vcs_info:*' enable bzr git hg svn |
|
|
|
zstyle ':vcs_info:*' check-for-changes true |
|
|
|
zstyle ':vcs_info:*' check-for-changes true |
|
|
|
zstyle ':vcs_info:*' stagedstr '%F{green}●%f' |
|
|
|
zstyle ':vcs_info:*' stagedstr '%F{green}●%f' |
|
|
@ -36,6 +39,7 @@ function prompt_minimal_setup { |
|
|
|
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b|%F{cyan}%r%f' |
|
|
|
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b|%F{cyan}%r%f' |
|
|
|
zstyle ':vcs_info:git*+set-message:*' hooks git-status |
|
|
|
zstyle ':vcs_info:git*+set-message:*' hooks git-status |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Define prompts. |
|
|
|
PROMPT='%2~${vcs_info_msg_0_} » ' |
|
|
|
PROMPT='%2~${vcs_info_msg_0_} » ' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|