I use this plugin combined with zsh-autosuggestions. I observed that since using this plugin the highlighting for the autosuggestion flickers. So while typing I see as usual the autosuggestion command in the configured color (usually kinda decent colored). But then it starts to flicker. So it looks like a regular command. It becomes hard to tell that I not simply accepted this suggestion. Continue to type often restores the actual highlighting.
I must admit that my knowledge of all the background is minimal. So I wonder if you maybe have an idea why this happens. I can confirm that if I disable this plugin here temporally, the highlighting works fine.
I see this effect only if I have zsh-autocomplete, zsh-autosuggestions _and_ zsh-syntax-highlighting enabled. I presume you have the latter installed, too?
My guess is that there's just too much going on at the same time. ๐ But why do you need zsh-autosuggestions if you already have zsh-autocomplete?
By the way, when I replace zsh-syntax-highlighting with https://github.com/zdharma/fast-syntax-highlighting/, then I get flickering in the current word being typed only (because whenever completions are being list, the current word turns white), but no more flickering in zsh-autosuggestions' postdisplay. You should try it. ๐
Okay, I'll give this plugin suggestion a chance. Thank you.
But why do you need zsh-autosuggestions if you already have zsh-autocomplete?
I don't get the question. It is pretty much different...
@weilbith Let's not close this issue just yet! ๐ I'll see what I can do from my end to lessen the problem.
I don't get the question. It is pretty much different...
What exactly do you use zsh-autosuggestions for? I tried it now, but I have to say, I find it rather confusing to have both zsh-autosuggestions and zsh-autocomplete active at the same time.
And now I noticed that having both zsh-autosuggestions and zsh-autocomplete installed actually makes menu selection buggy. I wonder if I just have to declare these two incompatible? ๐ค
@weilbith I just noticed that I I use _fast-syntax-highlighting_ with zsh-autocomplete, then the highlighting itself flickers on and off. So, that doesn't really solve the problem.
However, if I use _zsh-syntax-highlighting_ with zsh-autocomplete but _without zsh-autosuggestions_, then everything works perfectly.
And, as I mentioned, if I use _zsh-autosuggestions_ with zsh-autocomplete without any kind of syntax highlighting, then everything works fine, too.
I'll have to investigate some more.
What exactly do you use zsh-autosuggestions for? I tried it now, but I have to say, I find it rather confusing to have both zsh-autosuggestions and zsh-autocomplete active at the same time.
Well I have a few commands that I use frequently or need more often. While the time frame could be rather long, but commands that you need then and now. Therefore it is pretty nice to get them as suggestions. So I don't have to remind myself to somehow get this command by history or so, but it simply gets suggested and I can accept it easily. And this also works where no suggestion is given. This is especially the case for long commands. Let's say I have run a docker container manually from the shell. And the argument list was quite long. I added volumes, published ports, named it, etc pp. Even if it wasn't my last Docker command, when I entered the first few command parts (and here autocomplete can help), I get the suggestion to run this 3 line long command again. Super helpful, since it also includes paths for volumes etc.
But this also works for shorter commands, that are simply more rare and get not shadowed in the history. So the long Docker commands get only suggested when I match a certain prefix in the history. While until this point I get suggestions for commands I use more frequently in the history. But for commands I use rarely, the suggestion hits in early. Like lets say I want to start logging of my keyboard. I want to define a few standard arguments and also the input device path. But it is not worth an own alias or script. So As soon as I type the commands name, I get the full long command suggested.
That was quite long now. I hope it gave you an idea. I don't want to sell it to you. Rather argue why I definitely want to keep this plugin, because it has a high value for me.
And now I noticed that having both zsh-autosuggestions and zsh-autocomplete
installed actually makes menu selection buggy. I wonder if I just have to
declare these two incompatible? thinking
That would be really sad. I had to do a hard decision. And since I did not managed to configure autocompletion properly for me (still can't tab through suggestions by documentation, paths after / etc.), I'm not sure what my answer would be.
@weilbith I just noticed that I I use fast-syntax-highlighting with zsh-autocomplete, then the highlighting itself flickers on and off. So, that doesn't really solve the problem.
well, maybe the wording of "flickering" wasn't the best description. In fact it turns of the autosuggestions special highlight and when I type the next char(s) it enables again. So it is not continuously changing.
@weilbith Alright, there's the fix! Please try it out. zsh-autocomplete should now work flawlessly with zsh-users/zsh-autosuggestions plus your choice of zsh-users/zsh-syntax-highlighting or zdharma/fast-syntax-highlighting. I've tested all the combinations. ๐
Oh yeah that is awesome. Thank you so much for the quick solution. :tada:
Seem to work perfectly as the first tests show.
One note: while calling my plugin manager to update, it thrown an error due to git, because of a force-pushed history at the origin remote. Could that be? Or messed I something up locally. But actually I can't remember that I ever touched the cached plugin locally. If you did so, just the hint that this can cause issues for users. :wink:
Yeah, I did do a forced push, because I had accidentally committed some code that I shouldn't have committed yet. ๐
How much did this impact you? What did you have to do to work around it?
I changed to the local clone and and did git reset --hard origin/master. The remote data was already fetched due to the plugin manager. I guess if you are familiar with git in daily work you can solve/determine such issue easily. Not sure how others get along.
Never mind. Was just a hint. Thanks for your great help. Happy that it works nice again. :blush:
Which plugin manager do you use?
I use Antibody.
@weilbith Just a random remark: I just noticed that zsh-autocomplete is now _faster_ with zsh-users/zsh-syntax-highlighting than with zdharma/fast-syntax-highlighting. Oh, the irony! ๐
รh... lol? ๐คฃ
Hmm I can't seem to get this to work. Does anyone have a config that uses all three plugins with no syntax flickering? I'm using zinit if that helps.
@PythonNut When you say "all three plugins", do you use zdharma/fast-syntax-highlighting or zsh-users/zsh-syntax-highlighting?
I have tested zsh-autocomplete with zinit plus zsh-autosuggestions and zsh-syntax-highlighting, and it works fine, without flickering. It does not work well with zdharma/fast-syntax-highlighting at the moment, though. If you need support for that, please open a new issue for it. ๐
@PythonNut I fixed the zdharma/fast-syntax-highlighting integration and improved syntax highlighting/zsh-autosuggestions integration overall in 9899663b438dcb3e39cc8f62aa26ca3f67df9ba0. Please update and try it out.
It works perfectly with both syntax highlighting packages now. Thank you!