X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/e69caf640e206d5736bbac8d9a6dd75e63ec70c0..ec9f2140efb69f3f9e95b8b2fa3681e3ff07e38b:/etc/zsh/functions/Prompts/prompt_arrows_setup diff --git a/etc/zsh/functions/Prompts/prompt_arrows_setup b/etc/zsh/functions/Prompts/prompt_arrows_setup index 0e08413..9c59b8f 100644 --- a/etc/zsh/functions/Prompts/prompt_arrows_setup +++ b/etc/zsh/functions/Prompts/prompt_arrows_setup @@ -68,17 +68,24 @@ function prompt_arrows_setup() { PROMPT="%F{$c}>>> $hist" ;; *) - echo "Unknown prompt mode $m" + echo -E "Unknown prompt mode $m" return ;; } - PROMPT="$PROMPT%(1j,%F{$c}%j,)$vicol%#%F{$p}%n%F{$n}@%F{$p}%2m%(?..%F{$n}/%F{$r}\$?)%F{$n}: " + PROMPT="$PROMPT%(1j,%F{$c}%j,)$vicol%#%F{$p}%n%F{$n}@%F{$p}%2m%(?..%F{$n}/%F{$r}%?)%F{$n}: " POSTEDIT="$(print -P "%F{$n}%f")" autoload -Uz vcs_info - zstyle ':vcs_info:git*' formats "%c%u%%F{$p}%r/%b%%F{$n}/%%F{$d}%S%%f" - zstyle ':vcs_info:git*' actionformats "%%F{$r}(%a)%f %c%u%%F{$p}%r/%b%f/%%F{$d}%S%f" + zstyle ':vcs_info:git*' get-revision true + local gitformat="%c%u%F{$p}%r%F{$n} %F{$c}%7.7i%F{$n}:%F{$p}%b%F{$n} %F{$d}%S%f" + zstyle ':vcs_info:git*' formats $gitformat + zstyle ':vcs_info:git*' get-unapplied true + local patchformat=' %n/%a' + zstyle ':vcs_info:git*' patch-format $patchformat + zstyle ':vcs_info:git*' nopatch-format $patchformat + zstyle ':vcs_info:git*+post-backend:*' hooks prompt_arrows_revertfix + zstyle ':vcs_info:git*' actionformats "%F{$r}(%a%m)%f $gitformat" zstyle ':vcs_info:git*' stagedstr "%F{$c}+" - zstyle ':vcs_info:git*' unstagedstr "%F{$r}*" + zstyle ':vcs_info:git*' unstagedstr "%F{$r}!" # add-zsh-hook should have already been autoloaded by promptinit add-zsh-hook precmd prompt_arrows_precmd @@ -109,4 +116,8 @@ function prompt_arrows_preview { fi } +function +vi-prompt_arrows_revertfix() { + [[ -f "$gitdir/REVERT_HEAD" ]] && hook_com[action]=revert +} + prompt_arrows_setup "$@"