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

[Fix] Update Zsh completions and add Oh-My-Zsh plugin #128

Merged
merged 7 commits into from
Dec 16, 2024

Conversation

jackwrfuller
Copy link
Contributor

The ZSH completions (as they are currently documented) are broken.

This PR uses the correct autocompletion script, taken upstream from urfave/cli (Note the urfave/cli/v1 version, since thats what ahoy currently uses).

I think a better solution ultimately will be to create a new ahoy-cli/zsh-ahoy that is especially designed to house the autocompletion functionality, including the Oh-My-Zsh custom plugin that I have written (c.f zsh-autosuggestions).

@ocean
Copy link
Member

ocean commented Dec 12, 2024

@jackwrfuller Thanks for this!

I like your idea of having a dedicated plugin, but want to discuss.

If we were to create another repo for the zsh plugin, would that make it easier or harder for people to add the plugin to their setup in order to use it?

Options I see are:

  1. Create dedicated repo, put plugin in there, have info/FAQ about how to add it?
  2. Leave plugin in the repo (agree in principle that's not the best - i.e. we should "separate concerns") and automatically add it to people's setups if they're using zsh ?
  3. Something else?
  4. ...
  5. ... profit?

@jackwrfuller
Copy link
Contributor Author

In my opinion, having it as a separate repo would be easier to maintain and easier to install.

It is more in line with how other custom oh-my-zsh plugins operate, e.g zsh-autosuggestions as I linked above.
They have a oneliner where they git clone from from the plugin repo:

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

which in our case could become:

git clone https://github.com/ahoy-cli/zsh-ahoy ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ahoy

@ocean
Copy link
Member

ocean commented Dec 12, 2024

Ok @jackwrfuller sounds good!

I've created the repo, please go ahead moving the Zsh completion plugin from your current PR into the new repo 👍

https://github.com/ahoy-cli/zsh-ahoy 🚀

Note: if possible, please make the plugin as generic as possible so it can work for anyone using Zsh, not just Oh-My-Zsh users (e.g. I use the Sheldon Zsh plugin manager for my plugins) 😄

@jackwrfuller
Copy link
Contributor Author

jackwrfuller commented Dec 12, 2024

I have created the initial PR for zsh-ahoy: ahoy-cli/zsh-ahoy#1

I will now update this PR to remove the autocomplete directory and update the zsh completion instructions.

I'm not familiar with Sheldon, but i have included installation instructions for just bare zsh. I can look into Sheldon soon if you would like me to.

@ocean ocean merged commit 62a310f into ahoy-cli:master Dec 16, 2024
3 checks passed
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.

2 participants