Zsh-autocomplete: Asynchronous feature stopped plugin from working

Created on 5 Jun 2020  ยท  14Comments  ยท  Source: marlonrichert/zsh-autocomplete

Hey :wave:

Thanks again for your continuous work. Especially the asynchronous feature makes this plugin a must-have! Unfortunately it does not work anymore for me. Which means it does not appear automatically anymore, but I must trigger the suggestions manually with tab again. Note that I configured the plugin to use tab and also do the suggestions appear grouped, as I also configured for this plugin. So the plugin is still there and somehow working. But not automated anymore.

So my local version is on commit 0260d55e28746b29a93f5c80ee0f20906b742c20 which is the HEAD@master here on GitHub for the moment. I tried to do a minimized setup, but this fails already. So how do I try to achieve a minimal testing environment for reproducibility:

> zsh -d -f  # zsh without any configuration
host% source $XDG_CACHE_HOME/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-marlonrichert-SLASH-zsh-autocomplete/zsh-autocomplete.plugin.zsh
host% fpath+=($XDG_CACHE_HOME/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-marlonrichert-SLASH-zsh-autocomplete)
host% cd ~/  # expect auto completion here

Of course can the location of the plugin differ. Since I use antibody as my zsh plugin manager that's how it looks for me. Anyways I load the plugin manually here, doing the same as antibody would do. The point is, that already the source command fails with the error message (eval):1: _autocomplete.add-zsh-hook: function definition file not found. I guess that's bad. :joy:
So if we could make it to fix this minimized setup, then I could continue to checkout if something else in my custom setup affects this problem.

Thank you so much in advanced. I want to experience the asynchronous completion
myself!!!!

Bug report

All 14 comments

Hm, I can reproduce that, but I have no idea why it's not working. I'll have to investigate.

@weilbith Alright, this should fix it. Please update.

Cool. Thanks for the fix. Now I get the completion for the minimal zsh. Let's see why this is not working for my custom setup. :+1:

Unfortunately I can't reopen this issue. But I found the source of the issue. The following two lines in my .zshrc cause it. If I comment them out it works like charm.

zle-line-init() { zle -K vicmd; }
zle -N zle-line-init

I have them to always start the prompt in vi's normal mode rather than insert mode as usual. This was working with this plugin in the past, but does not anymore.

Thanks for reporting. I know how to fix it.

@weilbith This should now be fixed on the dev branch. Please try it out.

Jop works. I should consider to switch my plugin manager. Wasn't able to change branch for some reason (took no effect) and also not manually. Had to to it completely manually. Buuuut that is not the topic. ^^

Thanks for fixing it.
Could you give a quick headsup here when it is in master?

I use https://github.com/zdharma/zinit as my plugin manager. Have a look at my .zshrc file for an example of how to use it. Hm, I just noticed I haven't updated it in a while. I probably should. ๐Ÿ˜… (Edit: Just updated.)

Yes, I will give you a heads-up. ๐Ÿ™‚

Yeah I'm aware of zinit. But since I was pretty happy with antibody so far and because zinit looks like an overkill, I hesitate to switch so far. But actually I like such powerful tools like zinit. Maybe I should invest the time to read the details and figure out how I can profit by them. For example which of my plugins could be lazy loaded etc.

I'm keeping this issue open until I've merged to master. ๐Ÿ™‚

Most of zinit's feature you don't really need. And if you want lazy loading, just use Powerlevel10k's instant prompt feature which will cause (almost) your entire .zshrc to be lazily loaded.

But it does come in handy sometimes that zinit has such a powerful feature set. Also, it's very fast.

just use Powerlevel10k's instant prompt feature

I do :grimacing:

Unfortunately there is no comparison with antibody. But since I use the approach to trigger the plugin bundling manually and then just source that, I can barely believe it can become faster. For the "on-the-fly" bundle within the .zshrc I guess it is a different story.

I have no idea what you mean with "plugin bundling". ๐Ÿ™‚

The first time you call zinit on a plugin, it clones the repo, then sources it. Afterwards, it will just source it. It updates your plugins when you tell it to do so. Yeah, it can tell it to do a bunch of extra stuff whenever it clones, updates or sources a plugin, but that's optional.

@weilbith It's in master now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paw-lu picture paw-lu  ยท  4Comments

cenk1cenk2 picture cenk1cenk2  ยท  3Comments

g4cm4n picture g4cm4n  ยท  6Comments

romzie picture romzie  ยท  7Comments

mimoo picture mimoo  ยท  5Comments