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