zsh-autosuggestions/src/strategies/default.zsh
2017-09-27 13:24:06 -06:00

16 lines
498 B
Bash

#--------------------------------------------------------------------#
# Default Suggestion Strategy #
#--------------------------------------------------------------------#
# Suggests the most recent history item that matches the given
# prefix.
#
_zsh_autosuggest_strategy_default() {
local prefix="$1"
# Get the history items that match
# - (r) subscript flag makes the pattern match on values
typeset -g suggestion="${history[(r)${(b)prefix}*]}"
}