diff --git a/README.md b/README.md index 2dc3eec..5efd89c 100644 --- a/README.md +++ b/README.md @@ -59,12 +59,11 @@ subcommands and, for `show` and `complete`, the reference argument — by callin (`Stdlib` open, package-qualified `/pkg/...` paths, kind tags like `type-`, section labels, …). Type `.` or `/` and press TAB again to drill in. -`opam install` puts it under `$OPAM_SWITCH_PREFIX/share/odoc-switchdocs/zsh`. -That directory isn't on zsh's `$fpath` by default, so add it (before -`compinit`) in `~/.zshrc`: +`opam install` puts it under the package's share dir. That directory isn't on +zsh's `$fpath` by default, so add it (before `compinit`) in `~/.zshrc`: ```zsh -fpath=("$OPAM_SWITCH_PREFIX/share/odoc-switchdocs/zsh" $fpath) +fpath=("$(opam var odoc-switchdocs:share)/zsh" $fpath) autoload -U compinit && compinit ``` diff --git a/completions/zsh/_switchdocs b/completions/zsh/_switchdocs index cdb096e..131a37f 100644 --- a/completions/zsh/_switchdocs +++ b/completions/zsh/_switchdocs @@ -3,9 +3,9 @@ # zsh completion for switchdocs. # # Install: put this file's directory on $fpath before compinit. After -# `opam install` it lives under the switch's share dir; add to ~/.zshrc: +# `opam install` it lives under the package's share dir; add to ~/.zshrc: # -# fpath=("$OPAM_SWITCH_PREFIX/share/odoc-switchdocs/zsh" $fpath) +# fpath=("$(opam var odoc-switchdocs:share)/zsh" $fpath) # autoload -U compinit && compinit # # (or point $fpath at completions/zsh in a source checkout.)