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() {
|
2016-04-25 14:19:26 -06:00
|
|
|
local prefix="$1"
|
2016-03-01 12:45:55 -07:00
|
|
|
|
2016-03-05 21:03:14 -07:00
|
|
|
# Get the keys of the history items that match
|
|
|
|
local -a histkeys
|
|
|
|
histkeys=(${(k)history[(r)$prefix*]})
|
2016-03-01 12:45:55 -07:00
|
|
|
|
2016-03-05 21:03:14 -07:00
|
|
|
# Echo the value of the first key
|
|
|
|
echo -E "${history[$histkeys[1]]}"
|
2016-03-01 12:45:55 -07:00
|
|
|
}
|