Skip to content

Commit

Permalink
Clarifying the zsh documentation (#1525)
Browse files Browse the repository at this point in the history
Fixes #585
Fixes #1424

RELEASE_NOTES=[DOCUMENTATION] Improve documentation of Zsh completion setup

Signed-off-by: Yolan Romailler <[email protected]>
  • Loading branch information
AnomalRoil authored Aug 14, 2020
1 parent ce948cd commit bce0bdc
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,27 @@ source /dev/stdin <<<"$(gopass completion bash)"

If you use zsh, `make install` or `make install-completion` should install the completion in the correct location.

If zsh autocompletion is still not functional, you can run the following commands:
If zsh autocompletion is still not functional, or if you want to install it manually, you can run the following commands:

```
```bash
$ gopass completion zsh > ~/_gopass
$ sudo mv ~/_gopass /usr/share/zsh/site-functions/_gopass
$ rm -i ${ZDOTDIR:-${HOME:?No ZDOTDIR or HOME}}/.zcompdump && compinit

```
Exit and re-run zsh if the last command failed.
Then exit and re-run zsh if the last command failed.

Notice that it is important to directly redirect Gopass' output to a file,
using pipes or echo mess up the output. Also notice that the generated `_gopass` file is
a completion file that is supposed to be handled by zsh and to be installed in the zsh
completions directory, as defined by either the standard `/usr/share/zsh/site-functions/` path,
or by a user-specified `fpath` folder. It is not meant to used with `source`.

If zsh completion is still not working, you might want to add the following to your `.zshrc` file:
```bash
autoload -U compinit && compinit
```
if you don't have it already.

### Enable fish completion

Expand Down

0 comments on commit bce0bdc

Please sign in to comment.