zsh: Add stash display to pure prompt

Added stash being shown in git repositories (if there is a stash),
moved some initialization slightly.
This commit is contained in:
Marty Oehme 2021-08-25 20:47:07 +02:00
parent f08c8ebefd
commit 658e07e1b8
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -4,6 +4,9 @@
CONFDIR="${XDG_CONFIG_HOME:-$HOME/.config}" CONFDIR="${XDG_CONFIG_HOME:-$HOME/.config}"
ZSHCONFDIR="$CONFDIR/zsh" ZSHCONFDIR="$CONFDIR/zsh"
# load completion, extended zsh moving syntax, zle edit in vim (or other $EDITOR) possibility
autoload -Uz compinit zmv edit-command-line promptinit
# Set completion style # Set completion style
# The following lines were added by compinstall # The following lines were added by compinstall
zstyle ':completion:*' completer _complete _ignored _approximate zstyle ':completion:*' completer _complete _ignored _approximate
@ -11,6 +14,7 @@ zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]} r:|[._-]=** r
zstyle ':completion:*' menu select=1 zstyle ':completion:*' menu select=1
zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s
zstyle :compinstall filename "$ZSHCONFDIR/.zshrc" zstyle :compinstall filename "$ZSHCONFDIR/.zshrc"
compinit
# End of lines added by compinstall # End of lines added by compinstall
# load plugins # load plugins
@ -61,16 +65,13 @@ zstyle ':fzf-tab:complete:kill:argument-rest' extra-opts --preview=$extract'ps -
# give a preview of directory by exa when completing cd # give a preview of directory by exa when completing cd
zstyle ':fzf-tab:complete:cd:*' extra-opts --preview=$extract'exa -1 --color=always $realpath' zstyle ':fzf-tab:complete:cd:*' extra-opts --preview=$extract'exa -1 --color=always $realpath'
# load completion, extended zsh moving syntax, zle edit in vim (or other $EDITOR) possibility
autoload -Uz compinit zmv edit-command-line promptinit
compinit
# pure prompt init # pure prompt init
promptinit promptinit
prompt pure
# make it single line # make it single line
prompt_newline='%666v' prompt_newline='%666v'
PROMPT=" $PROMPT" # show git stash status as a ≡
zstyle :prompt:pure:git:stash show yes
prompt pure
# shellcheck source=alias # shellcheck source=alias
[ -f "$CONFDIR/sh/alias" ] && source "$CONFDIR/sh/alias" [ -f "$CONFDIR/sh/alias" ] && source "$CONFDIR/sh/alias"