0

According to the documentation in man zshcompsys, there is a widget menu-select that is defined in the complist module.

If you use the menu-select widget, which is part of the zsh/complist module, you should make sure that that module is loaded before the call to compinit so that that widget is also re-defined.

man zshmodules also mentions:

Note, however, that complist will not automatically be loaded if it is not linked in: on systems with dynamic loading, `zmodload zsh/complist' is required.

So I have added this in my ~/.zshrc:

# .....(other stuff)
#
# load complist module to make "menu-select" widget available to zle
zmodload zsh/complist
autoload -Uz complist
complist
# Load zsh's completion system "compsys"
autoload -Uz compinit
compinit
# ....

however on zsh startup, I get this output

.zshrc:44: complist: function definition file not found

What I'm actually trying to do is load the widget menu-select, if anyone can offer a solution that does that - whether it involves loading complist.so or not that would be great

  • my OS - Ubuntu 16.04.1
  • my zsh - version 5.1.1

For completeness, the reason I am trying to load menu-select is because I want to be able to bind it to a key combination and call it manually, I can use zstyle to get menu-select completion, (I believe when menu-select is invoked this way the completions system does everything needed to bootstrap menu-select) but the zstyle way I can't control/call the widget manually.

  • Where in the man pages tells you to autoload complist? – llua Aug 16 '16 at 13:06
  • @llua good question. I dont think the man page does say to autoload complist. they only mention "you should make sure complist is loaded" I assumed - perhaps mistakenly? - that you autoloaded simply because thats how other features, e.g. compinit were loaded – the_velour_fog Aug 16 '16 at 13:21
  • You loaded complist with zmodload zsh/complist, nothing else is needed. you are free to bind the widget after that. – llua Aug 17 '16 at 3:01
  • @llua I tried what you said and it worked! thanks for the help. I'm guessing the reason complist gets loaded with zmodload is because it is a module written in C. and compinit is written in zsh scripts placed somewhere in fpath? therefore for future usages, if the module is a module.so file in a directory like /usr/lib/x86_64-linux-gnu/zsh/5.1.1/zsh then use zmodload, if the module is somewhere in fpath then it (probably) should be autoloaded. – the_velour_fog Aug 17 '16 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.