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

What would be the correct way to add fish completions? #13

Open
tlaerm opened this issue Nov 3, 2020 · 3 comments
Open

What would be the correct way to add fish completions? #13

tlaerm opened this issue Nov 3, 2020 · 3 comments
Labels
question Further information is requested

Comments

@tlaerm
Copy link
Contributor

tlaerm commented Nov 3, 2020

I'm still getting used to the xxh structure and want to add docker completions to my fish.
If I just add them to the local .xxh they will not be updated when the upstream changes.

So would I make a plugin that curls https://raw.githubusercontent.com/docker/cli/master/contrib/completion/fish/docker.fish and the one for docker-compose?

@tlaerm
Copy link
Contributor Author

tlaerm commented Nov 3, 2020

Context: These completions get added to local shells from the docker packages and are stored in /usr/share/fish/vendor_completions.d (on an Ubuntu system).

@anki-code
Copy link
Member

anki-code commented Nov 3, 2020

Hi @rdd2!

Something tells me that you can just source this files. What if you run source /usr/share/fish/vendor_completions.d/docker.fish - is it working?

If yes this means that you can:

  1. Fork xxh-plugin-fish-example or xxh-plugin-fish-ohmyfish
  2. Rename it to xxh-plugin-fish-docker
  3. Change the build.sh script to curl the files and place it to the build dir
  4. Finally add getting the plugin directory and the "sourcing" the files to the pluginrc file i.e. like in xxh-plugin-fish-ohmyfish

If it's not working for you and the completion files should be in appropriate directory the good start is to understand how to change the path to this directory.

PS: How xxh works: Detailed workflow with code

@frederickjh
Copy link
Contributor

@rdd2 Completions for the Fish shell locally should be placed in ~/.config/fish/completions. If you are using the xxh-plugin-fish-userconfig plugin then locally they would go in ~/.xxh/.xxh/config/xxh-plugin-fish-userconfig/fish/completions so that they are transferred to the remote xxh host.

From the help for the xxh-plugin-fish-userconfig plugin:

Fish Shell Remote Host Configuration

Place the configuration files you want transfered to the remote host in ~/.xxh/.xxh/config/xxh-plugin-fish-userconfig/fish on your local computer. The files in this folder are the same as you would place in the ~/.config/fish/ directory for your local Fish shell installation.

You can create directories for functions, completions, and program configuration conf.d. These directories and their contents will be transfered to the remote host. They will be copied into the xxh Fish shell's configuration directory.

@anki-code anki-code added the question Further information is requested label Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants