mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-18 18:58:54 +02:00
Initial working version of control-r search
This commit is contained in:
@@ -21,3 +21,16 @@ function _hishtory_precmd() {
|
||||
fi
|
||||
(hishtory saveHistoryEntry zsh $_hishtory_exit_code "$_hishtory_command" $_hishtory_start_time &)
|
||||
}
|
||||
|
||||
_hishtory_widget() {
|
||||
BUFFER=$(hishtory tquery $BUFFER | tr -d '\n')
|
||||
CURSOR=${#BUFFER}
|
||||
zle reset-prompt
|
||||
}
|
||||
|
||||
_hishtory_bind_control_r() {
|
||||
zle -N _hishtory_widget
|
||||
bindkey '^R' _hishtory_widget
|
||||
}
|
||||
|
||||
[ "$(hishtory config-get enable-control-r)" = true ] && _hishtory_bind_control_r
|
||||
|
Reference in New Issue
Block a user