mirror of
https://github.com/ddworken/hishtory.git
synced 2024-12-23 23:39:02 +01:00
control-r for bash
This commit is contained in:
parent
f9a01a56cb
commit
710e4dd901
@ -27,3 +27,14 @@ function __hishtory_postcommand() {
|
||||
}
|
||||
PROMPT_COMMAND="__hishtory_postcommand; $PROMPT_COMMAND"
|
||||
export HISTTIMEFORMAT=$HISTTIMEFORMAT
|
||||
|
||||
__history_control_r() {
|
||||
READLINE_LINE=$(hishtory tquery "$READLINE_LINE" | tr -d '\n')
|
||||
READLINE_POINT=0x7FFFFFFF
|
||||
}
|
||||
|
||||
__hishtory_bind_control_r() {
|
||||
bind -x '"\C-r": __history_control_r'
|
||||
}
|
||||
|
||||
[ "$(hishtory config-get enable-control-r)" = true ] && __hishtory_bind_control_r
|
||||
|
Loading…
Reference in New Issue
Block a user