# Admone Zsh prompt
-# Copyright Armaan Bhojwani 2020 <code@armaanb.net>
+# Copyright Armaan Bhojwani 2021 <me@armaanb.net>
# MIT licensed, see the LICENSE file for more information.
-# Git repo at <https://codeberg.org/armaan/admone>
#######################################################################
# USER CONFIGURATIONS
INCLUDE="admone-pwd;admone-vcs;admone-exit-code"
FORMAT_LOWER="%B%F{%(?.cyan.red)}"
-TRANSIENT_PROMPT="1" # This is buggy
+TRANSIENT_PROMPT="0" # This is buggy
SHORT_PROMPT="➤"
FORMAT_SHORT="%B%F{%(?.cyan.red)}"
}
admone-vcs() {
echo "%F{green}${vcs_info_msg_0_}%f"
- VCS="1"
}
admone-exit-code() {
([[ $SHOW_0_EXIT_CODE == "1" ]] && echo "%(?,%F{cyan}%?%f,%F{red}%?%f)") ||
admone-24hr() {
echo $(date +%T)
}
-# Intergration with https://codeberg.org/armaan/zsh-command-time
-admone-time() {
- echo "%F{cyan}$timer_show%f"
-}
#######################################################################
# BACKEND
# Set everything!
if [[ $TRANSIENT_PROMPT == "1" ]]; then
- SHORT_PROMPT=$FORMAT_SHORT$SHORT_PROMPT%f' '
+ SHORT_PROMPT=$FORMAT_SHORT$SHORT_PROMPT' '%f%b
set-transient-prompt() {
if [[ $PROMPT != $SHORT_PROMPT ]]; then
trap 'set-transient-prompt; return 130' INT
fi
-if [[ $VCS = "1" ]]; then
+if [[ ! $(echo $INCLUDE | grep -q "vcs") ]]; then
zstyle ':vcs_info:*' check-for-changes true
autoload -Uz add-zsh-hook vcs-info
add-zsh-hook precmd vcs_info