mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
18 lines
528 B
Bash
18 lines
528 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 keys of the history items that match
|
|
local -a histkeys
|
|
histkeys=(${(k)history[(r)$prefix*]})
|
|
|
|
# Echo the value of the first key
|
|
echo -E "${history[$histkeys[1]]}"
|
|
}
|