helix icon indicating copy to clipboard operation
helix copied to clipboard

docs: document shell completion

Open krish-r opened this issue 1 year ago • 5 comments

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:

krish-r avatar May 31 '24 18:05 krish-r

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.

archseer avatar Jun 03 '24 08:06 archseer

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?

David-Else avatar Jun 03 '24 09:06 David-Else

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 avatar Jun 03 '24 16:06 krish-r

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.

krish-r avatar Jun 03 '24 17:06 krish-r

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.

eliliam avatar Jun 12 '24 23:06 eliliam

Closing this PR as it's probably outdated. Thanks everyone for your reviews and comments!

krish-r avatar May 24 '25 07:05 krish-r