Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions docs/docs/usage/shell.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,12 @@ in order for the changes to take effect.
```shell
hermit shell-hooks --bash
```

### Fish

This will install Hermit hooks into `~/.config/fish/conf.d/hermit.fish`. Restart your shell
in order for the changes to take effect.

```shell
hermit shell-hooks --fish
````
10 changes: 10 additions & 0 deletions shell/files/fish_hooks.fish
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@ function activate_hermit --on-variable PWD
type -q _hermit_deactivate; and _hermit_deactivate
end
end

function __complete_hermit
set -q HERMIT_ROOT_BIN; or set HERMIT_ROOT_BIN "$HOME/bin/hermit"
set -lx COMP_LINE (commandline -cp)
test -z (commandline -ct)
and set COMP_LINE "$COMP_LINE "
$HERMIT_ROOT_BIN noop
end

complete -f -c hermit -a "(__complete_hermit)"
1 change: 0 additions & 1 deletion shell/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const (

fishInstallationScript = `if status is-interactive
set -q HERMIT_ROOT_BIN; or set HERMIT_ROOT_BIN $HOME/bin/hermit
echo "Using $HERMIT_ROOT_BIN"
eval "$(test -x $HERMIT_ROOT_BIN && $HERMIT_ROOT_BIN shell-hooks --print --fish)"
end`
)
Expand Down
Loading