croc
croc copied to clipboard
Add _croc zsh completion file
how does this need to be installed?
It should be placed in one of the completion directories of $fpath
, e.g. /usr/share/zsh/vendor-completions
or ~/.oh-my-zsh/custom/completions
Cool! Would you mind adding this to the install script? https://github.com/schollz/croc/blob/master/src/install/default.txt
I would, but I notice that there's already some code which appears to be related to completion (lines 718-721 in default.txt). However I can't find the zsh_autocomplete_croc
file that is referenced, and zsh_autocomplete
doesn't make sense to me.
Is that code incomplete? and if so shall I delete it and replace it with mine?
Yeah I think the zsh autocomplete is not as robust as yours. The current file is here: https://github.com/schollz/croc/blob/master/src/install/zsh_autocomplete
Feel free to replace it with your solution!
When I get the time
I know how to find the completions directory automatically using zsh ("${(M@)fpath:#*completions*}")
, but the install script is written in bash which means I'd have to do a series of tests for existence of certain assumed directories, which might not include the one that the user actually uses for completions. I think it might be better to just ask the user to copy the _croc file manually. What do you think?