In order to organize my zsh custom files folder structure, is there a standard directory structure for zsh?
I'm not talking about Oh-My-Zsh or any other framework, but for "vanilla" zsh custom files.
From now, I've seen this type of directory structure:
~/.zsh/
custom/
plugins/
themes/
or
~/.zsh/
functions/
themes/
library/
There is no standard folder structure. Zsh lets you organize your files in almost any way you like.
There are a couple of rules, though:
$HOME
.~/.zshenv
and, in there, assign $ZDOTDIR
to the dir where you want to keep the rest of your dotfiles (and make sure you do not put anything else in .zshenv
)..zshrc
is generally the only Zsh dotfile you need. Most of the others are there for legacy reasons only.$HISTFILE
, but on macOS and Debian, /etc/zshrc
sets it to ${ZDOTDIR:-$HOME}/.zsh_history
.$fpath
will be searched for functions. Examples in the Zsh documentation put custom functions in ~/myfns
or ~/myfuncs
./usr/local/share/zsh/site-functions
. This dir is by default in every user’s $fpath
.${ZDOTDIR:-$HOME}/.zcompdump
. You can change this by passing -d <dumpfile>
when you call compinit
(which you should call once and only once).${ZDOTDIR:-$HOME}/.zcompcache/
, but you can change this with zstyle ':completion:*' cache-path <dir>
.