mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
63816c5da8
According to a few tests, the `fc` builtin appears to be quite a bit faster than searching through the `$history` associative array when dealing with large history files (500K+).
11 lines
372 B
Bash
11 lines
372 B
Bash
|
|
#--------------------------------------------------------------------#
|
|
# Default Suggestion Strategy #
|
|
#--------------------------------------------------------------------#
|
|
# Suggests the most recent history item that matches the given
|
|
# prefix.
|
|
#
|
|
|
|
_zsh_autosuggest_strategy_default() {
|
|
fc -lnrm "$1*" 1 2>/dev/null | head -n 1
|
|
}
|