Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Zsh completion configuration with history-words as another group to _complete



Hello,

I am trying to figure out how to add "history-words" as a group within
_complete, similar to aliases or functions.

zstyle -e ':completion:*' completer \
   'compprefuncs=(_history_word_list) reply=(_complete _match
_approximate _ignored _prefix)'

cat /usr/share/zshcat
/usr/share/zsh/5.0.2/functions/Completion/Base/_history_word_list
#autoload
_history "$@"
return 0/5.0.2/functions/Completion/Base/_history_word_list
#autoload
_history "$@"
return 0

The list of history-words show up along with any other groups shown by
_complete or any of the completers in "reply". But, unfortunately, it
does not execute the matched word with one Enter keypress. I need to
press Enter twice for the history word to be used.

I am not sure if the above is the correct approach to this issue, or,
if I should be looking at changing _complete to add the
_history_words_list as a tag within the  _complete function instead.

Any thoughts, please?

Thanks
Joe



Messages sorted by: Reverse Date, Date, Thread, Author