Adapted Valodim's capture completion script to

implement a simple completion service
This commit is contained in:
Thiago de Arruda
2013-10-28 17:05:57 -03:00
parent edc762de64
commit c183ca22de
3 changed files with 147 additions and 1 deletions

View File

@@ -146,11 +146,13 @@ paused-autosuggest-self-insert() {
}
autosuggest-first-completion() {
local cursor=$CURSOR
zle .complete-word || return 1
CURSOR=$cursor
}
show-suggestion() {
[[ $LBUFFER == '' ]] && return
[[ -n $ZLE_DISABLE_AUTOSUGGEST || $LBUFFER == '' ]] && return
# TODO need a way to reset HISTNO so .history-beginning-search-backward
# will always retrieve the last matching history entry
# unset HISTNO