2016-03-02 03:45:55 +08:00
|
|
|
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# Default Suggestion Strategy #
|
|
|
|
#--------------------------------------------------------------------#
|
|
|
|
# Suggests the most recent history item that matches the given
|
|
|
|
# prefix.
|
|
|
|
#
|
|
|
|
|
|
|
|
_zsh_autosuggest_strategy_default() {
|
2017-09-10 10:35:19 +08:00
|
|
|
local prefix="$1"
|
2017-02-17 10:18:03 +08:00
|
|
|
|
|
|
|
# Get the history items that match
|
|
|
|
# - (r) subscript flag makes the pattern match on values
|
2017-09-27 21:55:12 +08:00
|
|
|
typeset -g suggestion="${history[(r)${(b)prefix}*]}"
|
2016-03-02 03:45:55 +08:00
|
|
|
}
|