Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Location of zcompdump Files

Tags:

zsh

Is it possible to change the location of .zcompdump and .zhistory files generated by ZSH?
They are polluting my Home Directory.
One possible solution I found was changing the value of $ZDOTDIR to $HOME/.config/zsh. I did the following, but it does not seem to work (temp files are still created in the home directory).

$ cat ~/.zshenv
ZDOTDIR=$HOME/.zsh
. $ZDOTDIR/.zshenv
like image 582
Danis Fermi Avatar asked Dec 11 '17 01:12

Danis Fermi


1 Answers

.zcompdump files are produced to speed up the running of compinit, Which initializes the shell completion in zsh. You could specify an explicit dump file by compinit -d <dumpfile> in your .zshrc to change the location where compdump are stored.

Change the value for HISTFILE to set different location to store you zsh command history.

like image 199
salmanulfarzy Avatar answered Oct 01 '22 00:10

salmanulfarzy