Skip to content

Commit

Permalink
add fpath entry outside of plugin
Browse files Browse the repository at this point in the history
compinit is called before plugins are loaded. to avoid having to call compinit
again after loading this plugin, suggest to set fpath outside of the plugin in
zshrc.

see also this issue zsh-users/zsh-completions#603
  • Loading branch information
bo5o authored and redxtech committed Jun 8, 2023
1 parent 77f31b0 commit 0bf3290
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ Install it with your favourite zsh package manager, or clone it directly to your
array in your `.zshrc` file:

```zsh
plugins=(... zsh-asdf-direnv)
export ASDF_DIR="$HOME/.asdf"
fpath=(${ASDF_DIR}/completions $fpath)

plugins = (... zsh-asdf-direnv)
```

## Usage
Expand Down
2 changes: 0 additions & 2 deletions zsh-asdf-direnv.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ _zsh_asdf_direnv_install_asdf() {

# source asdf and run the direnv hook, after adding completions to path
_zsh_asdf_direnv_load() {
fpath=(${ASDF_DIR}/completions $fpath)

# if specified only load the asdf wrapper, leaving the shims out of path
if test "$ZSH_ASDF_DIRENV_LIBONLY" = "true"; then
PATH="$PATH:$ASDF_DIR/bin"
Expand Down

0 comments on commit 0bf3290

Please sign in to comment.