upd hstr config in bashrc
This commit is contained in:
+6
-11
@@ -31,17 +31,12 @@ export HISTCONTROL=ignoreboth:erasedups # no duplicate entries
|
||||
export HISTFILESIZE=2500000
|
||||
export HISTSIZE=250000
|
||||
|
||||
# see: https://github.com/dvorka/hstr/issues/277
|
||||
export PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'history -a; history -n'
|
||||
|
||||
# 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 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
|
||||
fi
|
||||
# ensure synchronization between bash memory and history file
|
||||
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
|
||||
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 [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi
|
||||
export HSTR_TIOCSTI=y
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
|
||||
Reference in New Issue
Block a user