ripgrep: ZSH auto-completion does not complete search options
What version of ripgrep are you using?
rg --version
ripgrep 0.10.0
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)
How did you install ripgrep?
Cargo update
What operating system are you using ripgrep on?
MacOS 10.14.2 (18C54)
Describe your question, feature request, or bug.
it seems like ZSH tab auto completion broke, no longer getting auto-completion after typing rg "abc" --file (expect for it to suggest options)
If this is a bug, what are the steps to reproduce the behavior?
rg "abc" --file<Tab><Tab>
If this is a bug, what is the actual behavior?
autocompleting with ALL files name
If this is a bug, what is the expected behavior?
autocompleting with the search options
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (7 by maintainers)
I tried your suggestion with
rm -f ~/.zcompdump*and removed code at the end of my.zshrc. It seems to do the trick.Thanks @okdana
Deleting the
zcompdumpfile can fix issues with completion after installing/upgrading something, but doing it inzshrclike that will disablecompinit’s caching mechanism, forcing it to scan through all of your completion files every single time the shell starts. It’s similar to callingcompinitwith the-Doption. There are some situations where that’s what you’d want, but it doesn’t seem like the right fix if you’re just missing a completion function.Also, OMZ already runs
compinitfor you, so adding that to the end of yourzshrcis probably making it run twice, slowing it down even more.Lastly, i’m not sure that putting
/usr/local/share/zsh/site-functionsin yourfpaththere is really doing anything, since it’s already at the head of the defaultfpathin both the zsh shipped with macOS and the one in Homebrew.If you’re using
rgfrom Homebrew and you’re still having problems after deleting yourzcompdump(once, by hand), there’s probably something else going on in yourzshrcthat needs fixed