-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't seem to make completion work (taking oh-my-zsh docker plugins for example) #127
Comments
I've found that you cannot defer completions, unfortunately. That's not an antidote limitation, but a limitation of zsh-defer. Completions plugins like # ${ZDOTDIR:-$HOME}/.zsh_plugins.txt
# OMZ
ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/docker # if you want the completions but not the aliases, add kind:fpath
ohmyzsh/ohmyzsh path:plugins/terraform # if you want the completions but not the aliases, add kind:fpath
jeffreytse/zsh-vi-mode
# Now, run your completions at the end
belak/zsh-utils path:completion |
Thank you @mattmc3 for the quick answer. Unfortunately, that doesn't seem to work for me either. If I move the completion plugin(s) to the end, I get this error:
The only way I can make it work is if I put |
Got it. Taking a fresh look at the OMZ source, it appears that plugins are added to # ${ZDOTDIR:-$HOME}/.zsh_plugins.txt
# Add OMZ completions plugins to `fpath`
ohmyzsh/ohmyzsh path:plugins/docker kind:fpath
ohmyzsh/ohmyzsh path:plugins/terraform kind:fpath
# do normal plugins
jeffreytse/zsh-vi-mode
# Now, run your completions before OMZ's lib is loaded
belak/zsh-utils path:completion
# OMZ
ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/docker
ohmyzsh/ohmyzsh path:plugins/terraform Or, you might also consider whether you need OMZ's whole lib directory. At this point, we aren't really discussing a bug in antidote, but rather OMZ's dependency rat's nest. |
Still not working 🙁
Totally agree. TBH, I don't care about OMZ (or any other framework for that matter 😛); I just want my completion to be there 😆
It has some nice aliases for path navigation that I use regularly, but even if I disable it (comment it out), nothing changes, and I don't have auto complete A couple of questions for you:
Is only one of these enough? Or should I have both?
|
Hi Team, |
For me, the "manual" way mentioned in the docs seems to do the trick (it seems?) I have both plugins mentioned for completion:
Along with the code snippet mentioned in there, and it seems to do the trick maybe? FWIW, I'm not quite confident as this doesn't seem to be the recommended way, so I'm pretty sure something should be missing here! |
The zsh-users/zsh-completions plugin adds additional Zsh completion definitions for ~150 different commands. But, it doesn't run |
Hey all, I found a solution that is working for me: in my plugins file, I needed to explicitly call out the completions subdirectory for my fpath (I'm avoiding the aliases), and make sure it was followed by one of the
then, since One other note, from the OMZ Docker readme, if you're using the |
Thank you @AlexAxthelm for the reply. I was forced to use another plugin manager for the computer I had this issue with, but I'll try to give this a try if I get the chance. I'm also curious about what you said:
How can this be done? I had to force myself to always type |
@farzadmf in the OMZ Docker readme, they include this snippet that allows for zstyle ':completion:*:*:docker:*' option-stacking yes
zstyle ':completion:*:*:docker-*:*' option-stacking yes But this doesn't give you the completion for the flags, it just lets you still have completion for container names after passing |
Thank you @AlexAxthelm for the link (and the snippet). Seems like the side effect mentioned there isn't worth its convenience (it's not super hard to type |
As of June 2024, the recommended way of handling OMZ is now to include the new getantidote/use-omz plugin at the TOP of your |
@mattmc3 thank you for the update. As I mentioned a couple of comments above, I've been using the "manual" way mentioned in the docs, and it has been working fine. I gave this new way a shot, and I think my shell startup became slower, so I went back to the "manual" way. Does it make sense for the startup to become slower? My work Mac is a f...ing Intel machine, and each new shell takes at least 3s (yes, 3 seconds if it's fast!), and sometimes goes to 6s!!! I do a bunch of things on startup, and I'm OK with the delay, which on a "normal" Linux machine is around 200ms to 400ms, but the Mac is too terrible for me to tolerate another added delay |
@farzadmf - Here are some profiling tips that might help. Add this snippet to the very top of your Here's my top 10 for comparison: Note: I'm on an M3 MacBook so don't expect to hit my actual timings, but just generally what's comparatively slower for you. Also, if you happen to see "antidote-load" at the top of the list, that's because of how you loaded antidote. It's what's sourcing all your plugins, so ignore its timing and look for the actual plugins to see what's really running slow.
I also pretty regularly run romkatv/zsh-bench and get pretty good results:
You might also check to see what Zsh version you're running:
And finally, have a look at romkatv/powerlevel10k and its instant-prompt feature. That instant prompt will smooth over a lot of config sins, especially on older hardware. Best of luck! |
@mattmc3 thank you so much for all the tips, and sorry for the delayed reply. I'll definitely look into all those things.
Does this mean that there's a better way for me to load antidote if this happens?
A bit confused here; if it's taking long to source all plugins, can it be ignored? 🤔 Isn't it contributing to the total time?
I might have this (not sure TBH). I'm saying that because I see the prompt appear in my startup folder, which is a git repo. Seems like it takes some time to fully load the prompt since the branch information part is "grey" and then gets some "color", but during this transition, the prompt is unusable for me (so it appearing is a bit of a false impression that the prompt loaded). As I said, this may be another messed up thing in my computer, delaying thing and may have nothing to do with the instant-prompt feature. |
No. The recommended way to load antidote is absolutely to use
You are only using instant prompt if .zsh_plugins.txt contains
Based on the behavior you describe, I don't think you are. I suspect you have Feel free to post your |
Hi, I'm not sure what I'm missing, but auto completion doesn't seem to work for me.
This is my config:
And I'm trying to make
docker
andterraform
completions work.If I run
compinit
manually in a shell, they work in that shell. From the docs, it seems that adding those completion plugins at the top should work, but I don't know what I'm missing.I tried having them as
kind:defer
only (only1
line instead of the2
lines I have), but that doesn't work eitherIt might have something to do with zsh-vi-mode's "after init" commands, and I am using a
zvm_after_init()
function to run "extra commands", so I might need to do something similar for those plugins as well (however, I tried disablingzsh-vi-mode
, but I still don't have the completion)Can you please let me know if this issue can be solved? I really want to switch to
antidote
, but these are preventing me from doing that 🙁The text was updated successfully, but these errors were encountered: