I understand .zcompdump-* files are dumped configuration files that can speed up completion and that can be deleted safely. I would like to store them in a separate location since they clutter my home directory. What's a good way of doing so?

I know one option is to use the ZDOTDIR variable but that would force me to place all my zsh dot files in that location. I just want to store the .zcompdump files elsewhere.

1 Answer 1


In your .zshrc, change the invocation of compinit to add a -d option with the location of the file. For example:

compinit -d ~/.cache/zsh/zcompdump-$ZSH_VERSION
  • Thanks @Gilles. I assume I can still invoke this after loading oh-my-zsh ? Sep 11, 2017 at 19:12
  • 1
    @AmelioVazquez-Reina No, you have to change the place where compinit is invoked. If you invoke it twice, it'll create the file each time, with the name supplied on that invocation or as ~/.zcompdump if you don't pass -d. If you want your configuration rather than Robby Russell's, don't use oh-my-zsh. Sep 11, 2017 at 19:32
  • 3
    Note that the file won't be created if you don't have the ~/.cache/zsh/ directory Dec 10, 2017 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.