upd hstr config in bashrc

This commit is contained in:
2026-07-11 19:27:17 +02:00
parent 0903654a65
commit c3916abfd9
+3 -8
View File
@@ -31,17 +31,12 @@ export HISTCONTROL=ignoreboth:erasedups # no duplicate entries
export HISTFILESIZE=2500000 export HISTFILESIZE=2500000
export HISTSIZE=250000 export HISTSIZE=250000
# see: https://github.com/dvorka/hstr/issues/277 # ensure synchronization between bash memory and history file
export PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'history -a; history -n' export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
# type -P forces a PATH search, skipping builtins and so on
if type -P hstr >/dev/null; then
# hstr exists
# if this is interactive shell, then bind hstr to Ctrl-r (for Vi mode check doc)
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi
# if this is interactive shell, then bind 'kill last command' to Ctrl-x k # if this is interactive shell, then bind 'kill last command' to Ctrl-x k
if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi
fi export HSTR_TIOCSTI=y
# If not running interactively, don't do anything # If not running interactively, don't do anything
case $- in case $- in