Skip to content

Commit f49b34f

Browse files
committed
[FAQ] Add cache completions to $fpath when using plugin managers
1 parent cd6fd42 commit f49b34f

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

FAQ.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,25 @@ ls -l "$ZSH_CACHE_DIR"
373373
ls -l "$ZSH_CACHE_DIR/completions"
374374
```
375375

376-
If they don't exist, run `mkdir -p $ZSH_CACHE_DIR/completions` once, or add it in the zshrc file after defining `ZSH_CACHE_DIR`.
376+
If they don't exist, run `mkdir -p $ZSH_CACHE_DIR/completions` once, or add this command in the .zshrc file after defining `ZSH_CACHE_DIR`.
377+
378+
Finally, you should check whether this directory is also added to `$fpath`:
379+
380+
```zsh
381+
print -l $fpath | grep "$ZSH_CACHE_DIR/completions"
382+
```
383+
384+
A line should appear with the path to the `$ZSH_CACHE_DIR/completions` folder. If not, you should also add this directory to `$fpath` in your .zshrc file.
385+
386+
Here's what you should add to your .zshrc file to fix this, before any lines loading Oh My Zsh or its plugins:
387+
388+
```zsh
389+
ZSH_CACHE_DIR="$HOME/.cache/oh-my-zsh" # or any other directory you want
390+
mkdir -p "$ZSH_CACHE_DIR/completions"
391+
fpath=("$ZSH_CACHE_DIR/completions" $fpath)
392+
```
393+
394+
After that everything should work again.
377395

378396
> [!NOTE]
379397
> This is a workaround when using plugin managers. Ideally we want to make this so that it works out of the box with any plugin manager you use. If you encounter an issue related to this, please +1 Feature Request [#12583](https://github.com/ohmyzsh/ohmyzsh/issues/12583) and add a comment with the plugin manager affected if not already in the list.

0 commit comments

Comments
 (0)