helix
helix copied to clipboard
docs: document shell completion
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-completionpackage. (It's installed by default at least in the Distros I tested). - Elvish: Alternate option suggested in the completion file comments.
Screenshot:
References:
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.
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?
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/completiondirectory 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 -
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.
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.
Closing this PR as it's probably outdated. Thanks everyone for your reviews and comments!