Skip to content
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

Use OMZ completions-dir.txt to improve installation #835

Closed
wants to merge 2 commits into from
Closed

Use OMZ completions-dir.txt to improve installation #835

wants to merge 2 commits into from

Conversation

felipecrs
Copy link
Contributor

This implements ohmyzsh/ohmyzsh#10565.

Fixes #603.

@felipecrs
Copy link
Contributor Author

Waiting for #603 before marking as ready to review.

@felipecrs
Copy link
Contributor Author

My last commit addresses the concern raised in ohmyzsh/ohmyzsh#10412 (comment), where multiple entries of src could end up being added to fpath.

The approach I used was taken from https://unix.stackexchange.com/a/62581/427940, and I would really like to know if there better or cleaner approaches out there for handling such a situation in ZSH.

@nicoulaj
Copy link
Member

nicoulaj commented Jan 6, 2022

Hi, I understand this completions-dir.txt file is specific to OMZ ? I don't think this project should be polluted with this kind of plugin manager specific files, it just makes it harder for other packagers and users. Not a big deal, just my two cents.

@felipecrs
Copy link
Contributor Author

felipecrs commented Jan 6, 2022

Specifically for OMZ for now, this is a new feature that I'm introducing at ohmyzsh/ohmyzsh#10565. Other package managers can also make use of it if they want.

Also, isn't https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions.plugin.zsh already specific to OMZ?

@nicoulaj
Copy link
Member

nicoulaj commented Feb 8, 2022

The <foo>.plugin.zsh is the only convention that is widely adopted by "plugin managers".

Does anyone else have thoughts on this ?

@felipecrs
Copy link
Contributor Author

@nicoulaj just to mention, I totally understand your reasonings.

I'm just trying to solve an outstanding incompatibility issue between this project and OMZ. But any better ideas are 100% welcome, of course.

@z0rc
Copy link

z0rc commented Feb 9, 2022

Please don't. OMZ should deal with its own problems without the expense of other projects or users who don't use OMZ.

@mcornella
Copy link
Contributor

I agree, this solution is not elegant and any changes that we make need to be adopted by the majority of plugin managers. It seems that most PMs support changing $fpath in the .plugin.zsh file.

This is not taken into account in OMZ because the compinit call happens before the plugin.zsh file is read (this is to allow running compdef in the .plugin.zsh, most outstandingly used in the git plugin).

If there is a solution to allow support for completion changes in the .plugin.zsh file while running compinit later, this solution wouldn't even be needed. Other PMs seem to do this, so it looks to me like there's no need for this and we simply have to improve OMZ.

@felipecrs felipecrs closed this Feb 12, 2022
@felipecrs felipecrs deleted the completions-dir branch February 12, 2022 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

oh-my-zsh installation instructions are sub-optimal
4 participants