summaryrefslogtreecommitdiff
path: root/plugins/per-directory-history/per-directory-history.zsh
diff options
context:
space:
mode:
authorcohml <62400541+cohml@users.noreply.github.com>2023-11-29 04:15:32 -0500
committerGitHub <noreply@github.com>2023-11-29 10:15:32 +0100
commit418046e9583f635b0303e4b8cf31c356b175cec3 (patch)
tree0b4a3742a60c7a78dc910e63eaf79010a9880c68 /plugins/per-directory-history/per-directory-history.zsh
parent7e3fdf33ec53821e574b8d6df43bec7264c507ee (diff)
downloadzsh-418046e9583f635b0303e4b8cf31c356b175cec3.tar.gz
zsh-418046e9583f635b0303e4b8cf31c356b175cec3.tar.bz2
zsh-418046e9583f635b0303e4b8cf31c356b175cec3.zip
feat(per-directory-history): add option to reduce verbosity (#12069)
Co-authored-by: Chris Hamill <chamill@ets.org>
Diffstat (limited to 'plugins/per-directory-history/per-directory-history.zsh')
-rw-r--r--plugins/per-directory-history/per-directory-history.zsh11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/per-directory-history/per-directory-history.zsh b/plugins/per-directory-history/per-directory-history.zsh
index cfc4535d3..b33e0b5dd 100644
--- a/plugins/per-directory-history/per-directory-history.zsh
+++ b/plugins/per-directory-history/per-directory-history.zsh
@@ -59,6 +59,7 @@
[[ -z $HISTORY_BASE ]] && HISTORY_BASE="$HOME/.directory_history"
[[ -z $HISTORY_START_WITH_GLOBAL ]] && HISTORY_START_WITH_GLOBAL=false
[[ -z $PER_DIRECTORY_HISTORY_TOGGLE ]] && PER_DIRECTORY_HISTORY_TOGGLE='^G'
+[[ -z $PER_DIRECTORY_HISTORY_PRINT_MODE_CHANGE ]] && PER_DIRECTORY_HISTORY_PRINT_MODE_CHANGE=true
#-------------------------------------------------------------------------------
# toggle global/directory history used for searching - ctrl-G by default
@@ -68,13 +69,15 @@ function per-directory-history-toggle-history() {
if [[ $_per_directory_history_is_global == true ]]; then
_per-directory-history-set-directory-history
_per_directory_history_is_global=false
- zle -I
- echo "using local history"
+ if [[ $PER_DIRECTORY_HISTORY_PRINT_MODE_CHANGE == true ]]; then
+ zle -M "using local history"
+ fi
else
_per-directory-history-set-global-history
_per_directory_history_is_global=true
- zle -I
- echo "using global history"
+ if [[ $PER_DIRECTORY_HISTORY_PRINT_MODE_CHANGE == true ]]; then
+ zle -M "using global history"
+ fi
fi
}