Skip to content

Commit cd6fd42

Browse files
committed
[FAQ] Document completion issues with plugin managers
1 parent 0baf118 commit cd6fd42

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

FAQ.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ _If you don't find what you're looking for, and you think it should be covered b
3333
- [Completion issues](#completion-issues)
3434
- [I have enabled a completion plugin but the completion doesn't work](#i-have-enabled-a-completion-plugin-but-the-completion-doesnt-work)
3535
- [I see duplicate typed characters after I complete a command](#i-see-duplicate-typed-characters-after-i-complete-a-command)
36+
- [Completions are not loaded when using a plugin manager](#completions-are-not-loaded-when-using-a-plugin-manager)
3637
- [Zsh errors](#zsh-errors)
3738
- [zsh: no matches found](#zsh-no-matches-found)
3839
- [Some commands no longer work after installing Oh My Zsh](#some-commands-no-longer-work-after-installing-oh-my-zsh)
@@ -349,6 +350,34 @@ This usually happens because your theme uses UTF-8 characters but your `locale`
349350

350351
Similar issues: [#6985](https://github.com/ohmyzsh/ohmyzsh/issues/6985#issuecomment-412055789), [#3932](https://github.com/ohmyzsh/ohmyzsh/pull/3932), [#4529](https://github.com/ohmyzsh/ohmyzsh/issues/4529), [#4632](https://github.com/ohmyzsh/ohmyzsh/issues/4632).
351352

353+
#### Completions are not loaded when using a plugin manager
354+
355+
Some of the plugins in Oh My Zsh generate completion files dynamically, and puts them in the cache directory under `$ZSH_CACHE_DIR/completions`.
356+
357+
Oh My Zsh already sets this up for you, as part of the [init script](https://github.com/ohmyzsh/ohmyzsh/blob/master/oh-my-zsh.sh). However, plugin
358+
managers don't run this script automatically as they do some internal optimizations.
359+
360+
To check that you are affected by this, try:
361+
362+
```zsh
363+
echo $ZSH_CACHE_DIR
364+
```
365+
366+
It should return something like `/path/to/oh-my-zsh-folder/cache` or `$HOME/.cache/oh-my-zsh`.
367+
If not, add `ZSH_CACHE_DIR="$HOME/.cache/oh-my-zsh"` in your .zshrc file, before the plugin manager code.
368+
369+
Then, also check that the directories exist:
370+
371+
```zsh
372+
ls -l "$ZSH_CACHE_DIR"
373+
ls -l "$ZSH_CACHE_DIR/completions"
374+
```
375+
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`.
377+
378+
> [!NOTE]
379+
> 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.
380+
352381
### Zsh errors
353382

354383
#### zsh: no matches found

0 commit comments

Comments
 (0)