zsh-autosuggestions/lib/get_suggestion.zsh

12 lines
214 B
Bash
Raw Normal View History

2016-01-27 04:51:44 +01:00
_zsh_autosuggest_get_suggestion() {
local prefix=$1
local history_items=(${history[(R)$prefix*]})
for cmd in $history_items; do
if [ "${cmd:0:$#prefix}" = "$prefix" ]; then
echo $cmd
break
fi
done
}