Skip to content

Commit 3ab06d2

Browse files
committed
docs: document shell completion
1 parent 1796735 commit 3ab06d2

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

book/src/building-from-source.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- [Note to packagers](#note-to-packagers)
88
- [Validating the installation](#validating-the-installation)
99
- [Configure the desktop shortcut](#configure-the-desktop-shortcut)
10+
- [Configure shell completion](#configure-shell-completion)
1011

1112
Requirements:
1213

@@ -156,3 +157,45 @@ file. For example, to use `kitty`:
156157
sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop
157158
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
158159
```
160+
161+
### Configure shell completion
162+
163+
You can configure shell completion for Helix by copying the completion file into your shell's completion directory.
164+
165+
#### Bash
166+
167+
```sh
168+
cp contrib/completion/hx.bash ~/.local/share/bash-completion/completions/hx
169+
```
170+
171+
#### Zsh
172+
173+
```sh
174+
cp contrib/completion/hx.zsh ~/.config/zsh/completions/_hx
175+
```
176+
177+
Add the following in your `.zshrc` before initializing completions with `compinit`.
178+
179+
```sh
180+
fpath+=~/.config/zsh/completions
181+
```
182+
183+
#### Fish
184+
185+
```sh
186+
cp contrib/completion/hx.fish ~/.config/fish/completions/hx.fish
187+
```
188+
189+
#### Elvish
190+
191+
```sh
192+
cp contrib/completion/hx.elv ~/.config/elvish/lib/hx.elv
193+
```
194+
195+
Add the following in your `rc.elv`
196+
197+
```sh
198+
use hx
199+
```
200+
201+
> 💡 You may need to restart your shell in order for the changes to take effect.

0 commit comments

Comments
 (0)