-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat(completion): support sourcing zsh completion dynamically #2957
feat(completion): support sourcing zsh completion dynamically #2957
Conversation
78e7e1a
to
1b28717
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r? @okdana
1b28717
to
a7de1f8
Compare
Summary: Previously, you needed to save the completion script to a file and then source it. Now, you can dynamically source completions in zsh by running ```zsh $ source <(rg --generate complete-zsh) ``` Test plan: 1. Run `source <(rg --generate complete-zsh)` 2. Run `rg --generate=complete-zs<TAB>` Before this commit, you would get an error after step 1. After this commit, it should work as expected. Closes BurntSushi#2956
a7de1f8
to
7c2a7b0
Compare
I've left it in the FAQ and fixed up the wording by adding an appropriate caveat emptor. I guess since other projects have found it useful to suggest this method it's probably not too big of a deal for ripgrep to do it too. But the text now makes it clear that the "generate and source" approach is slower. 4ms might not seem like much, and indeed, I cannot perceive a 4ms lag, but if you accrue 10 of those kinds of things, it starts to pile up into something that is noticeable. |
@BurntSushi I'm using a self-built version now, but jooc when will the next release be so others can use it? |
I don't know, sorry. See: https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#when-is-the-next-release |
Summary:
Previously, you needed to save the completion script to a file and then
source it. Now, you can dynamically source completions in zsh by
running
Test plan:
source <(rg --generate complete-zsh)
rg --generate=complete-zs<TAB>
Before this commit, you would get an error after step 1.
After this commit, it should work as expected.
Closes #2956