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

docs: document shell completion #10862

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

krish-r
Copy link
Contributor

@krish-r krish-r commented May 31, 2024

Hello,

This PR adds shell completion section to the docs.

closes #3605 (As #4165 / #5534 - had already documented the Desktop shortcut section).

  • I've tested the commands on Fedora 40 & Ubuntu 24.04 VMs with Helix 24.03 (AppImage).
  • Zsh: To avoid adding another hidden directory to user's $HOME, I've tried to match the completion directory location with Fish.
  • Elvish: I'm not familiar with this shell. However, I was able to test it out based on the completion file comments & official docs.

To keep this minimal, I've not included the following to the docs:

  • mkdir -p <completion-dir>.
  • Bash: Installing bash-completion package. (It's installed by default at least in the Distros I tested).
  • Elvish: Alternate option suggested in the completion file comments.

Screenshot:
Helix_docs_document_shell_completion

References:

@the-mikedavis the-mikedavis added the A-documentation Area: Documentation improvements label Jun 3, 2024
@archseer
Copy link
Member

archseer commented Jun 3, 2024

I'm a bit conflicted by this, building from source shouldn't be the preferred build option and contrib/ is mainly for extras that I'd prefer not to offer direct support for. e.g. documenting the best possible directory for every shell seems like platform specifics best left to shell documentation.

@David-Else
Copy link
Contributor

https://github.com/scop/bash-completion/blob/main/README.md#faq says that ~/.local/share/bash-completion is the correct location for user bash completions, but this dir does not exist in Debian, maybe add a mkdir -p or a note on this?

@krish-r
Copy link
Contributor Author

krish-r commented Jun 3, 2024

contrib/ is mainly for extras that I'd prefer not to offer direct support for. e.g. documenting the best possible directory for every shell seems like platform specifics best left to shell documentation.

This makes sense. My first draft had just this :)

Configure shell completion

You can configure shell completion for Helix by copying the completion file from the repository's contrib/completion directory into your shell's completion directory.

But later, I added shell-specific subsections after checking out rustup book's installation section.
(Except Zsh, rest of the directories match IIRC)

However, I do not have any strong opinions on this, so I'm happy to swap that with something like -

hx_shell_completion_docs

@krish-r
Copy link
Contributor Author

krish-r commented Jun 3, 2024

sorry, missed to respond -

but this dir does not exist in Debian

Yes, none of the completion directories (except Fish's I think) were auto-created on Ubuntu / Fedora too.

@eliliam
Copy link

eliliam commented Jun 12, 2024

Thank you so much for documenting this! I saw the completions in the latest release tarball and could not find any documentation on how to correctly install them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documentation Area: Documentation improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doc: show instructions to install the desktop file and shell completions
5 participants