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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions book/src/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Note to packagers](#note-to-packagers)
- [Validating the installation](#validating-the-installation)
- [Configure the desktop shortcut](#configure-the-desktop-shortcut)
- [Configure shell completion](#configure-shell-completion)

Requirements:

Expand Down Expand Up @@ -156,3 +157,45 @@ file. For example, to use `kitty`:
sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
```

### Configure shell completion

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

#### Bash

```sh
cp contrib/completion/hx.bash ~/.local/share/bash-completion/completions/hx
```

#### Zsh

```sh
cp contrib/completion/hx.zsh ~/.config/zsh/completions/_hx
```

Add the following in your `.zshrc` before initializing completions with `compinit`:

```sh
fpath+=~/.config/zsh/completions
```

#### Fish

```sh
cp contrib/completion/hx.fish ~/.config/fish/completions/hx.fish
```

#### Elvish

```sh
cp contrib/completion/hx.elv ~/.config/elvish/lib/hx.elv
```

Add the following in your `rc.elv`:

```sh
use hx
```

> 💡 You may need to restart your shell in order for the changes to take effect.
Loading