dim-an / cod

cod is a completion daemon for bash/fish/zsh
Apache License 2.0
517 stars 23 forks source link

Added more comprehensive instructions for zsh #69

Closed TheBearodactyl closed 1 year ago

dim-an commented 1 year ago

Hey! Sorry for late answer.

I agree that completion system must be initialized and this is not reflected in documentation.

But proposed variant implies that you MUST call compinstall and from my experience it's not the case for most users. Usually users of zsh using framework like oh-my-zsh or initialized completion system in some other way. Such instuction would scare me if I was inexperienced user of zsh.

I would propose to put text like this in the end of zsh section.

NOTE. cod requires zsh completion system to be initialized. In many cases it is already the case (especially if you are using framework like oh-my-zsh). If not you might need to put compinit function call into your .zshrc or execute compinstall command. Check zsh documentation.

What do you think?

TheBearodactyl commented 1 year ago

Hey! Sorry for late answer.

I agree that completion system must be initialized and this is not reflected in documentation.

But proposed variant implies that you MUST call compinstall and from my experience it's not the case for most users. Usually users of zsh using framework like oh-my-zsh or initialized completion system in some other way. Such instuction would scare me if I was inexperienced user of zsh.

I would propose to put text like this in the end of zsh section.

NOTE. cod requires zsh completion system to be initialized. In many cases it is already the case (especially if you are using framework like oh-my-zsh). If not you might need to put compinit function call into your .zshrc or execute compinstall command. Check zsh documentation.

What do you think?

I really think it's more important to give instructions for people who use less popular plugin managers such as zplug, zinit, sheldon, and such, since there's already a shit tonna docs on oh-my-zsh plugins and not enough for other less popular plugin managers though. So it isn't really enough to merely imply that compinit needs to be executed in some way or another, but you should definitely have it listed as a prerequisite instead of just a warning that most users probably won't even notice. I hope that makes sense!

maybe something like this could be added to the end of the zsh section:

For those not using oh-my-zsh or a similar framework:

Please initialize completion using the compinit command before
trying to use this plugin, otherwise it will NOT work!!!! A good way to check whether your completion is already initialized is to check whether the command compadd works. If it does, then you're good to go; if not, then use the aforementioned command compinit to initialize it!

dim-an commented 1 year ago

I've added check that compsys is initialized + more instructions.

71

TheBearodactyl commented 1 year ago

I've added check that compsys is initialized + more instructions.

71

that sounds good :D