From 973a276791506b72aa9013190b6d9366ab9fd17f Mon Sep 17 00:00:00 2001 From: sev Date: Wed, 3 Mar 2021 04:21:04 -0600 Subject: [PATCH 1/1] add history to prompt, set opt HIST_REDUCE_BLANKS --- base/.zsh/functions/Prompts/prompt_arrows_setup | 6 ++++-- base/.zshrc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/base/.zsh/functions/Prompts/prompt_arrows_setup b/base/.zsh/functions/Prompts/prompt_arrows_setup index 9b935f1..08f3646 100644 --- a/base/.zsh/functions/Prompts/prompt_arrows_setup +++ b/base/.zsh/functions/Prompts/prompt_arrows_setup @@ -46,17 +46,19 @@ function prompt_arrows_setup() { p="${${SSH_CLIENT+$s}:-$p}" local clock="%F{$n}%T%f" dirvcs="%F{$d}"'${vcs_info_msg_0_:-%~}'"%f" + # XXX: linux only local battery=/sys/class/power_supply/BAT0/capacity [[ -e "$battery" ]] && clock+=" `cat $battery`%%" local vicol='%F{${${prompt_arrows_vimode:+'"$r"'}:-'"$c"'}}' + local hist="%F{$n}%h" case "$m" { 2line) - PROMPT="%f $clock $dirvcs"$'\n'"%F{$c}>>> " + PROMPT="%f $hist $clock $dirvcs"$'\n'"%F{$c}>>> " unset RPROMPT ;; right) RPROMPT="$dirvcs $clock" - PROMPT="%F{$c}>>> " + PROMPT="%F{$c}>>> $hist" ;; *) echo "Unknown prompt mode $m" diff --git a/base/.zshrc b/base/.zshrc index 014b039..c5e4093 100644 --- a/base/.zshrc +++ b/base/.zshrc @@ -11,7 +11,7 @@ setopt PROMPT_SUBST ## jobs setopt AUTO_CONTINUE ## history -setopt NO_HIST_SAVE_BY_COPY HIST_IGNORE_DUPS SHARE_HISTORY +setopt NO_HIST_SAVE_BY_COPY HIST_IGNORE_DUPS SHARE_HISTORY HIST_REDUCE_BLANKS ### keys # TODO: investigate "^[[200~" bracketed-paste -- 2.47.0