RC Logr 20190224 163437
Sunday, 24 Feb, 2019
Gotta remember the difference between the z-shell config files. The .zshenv
loads first, and is sourced by all zsh instances, so keep it small and enter only environment variables that are needed by any shell, whether interactive or non-interactive, like $PATH. Next .zprofile
is sourced just before .zshrc
and is read only at login, and can be used for variables that do not change frequently, like flags for compilation. Then comes .zshrc
which is executed at the start of an interactive session, and is used to define aliases, functions, shell options (e.g. for history, or your prompt) and any key bindings. The .zlogin
file is sourced after the shell is fully set up, and usually compiles completions and maybe shows a “fortune”, or starts X on linux systems. At last comes .zlogout
, which might be used to clear settings or release resources.