Skip to content

Latest commit

 

History

History

.zsh-config

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

zsh setup

The list and order of startup files for zsh (Ch 2) are (ZDOTDIR if not set defaults to HOME):

  1. /etc/zshenv
    Always run for every zsh. (not present on my MBP)
  2. $ZDOTDIR/.zshenv
    Usually run for every zsh (see below).
  3. /etc/zprofile
    Run for login shells.
  4. $ZDOTDIR/.zprofile
    Run for login shells.
  5. /etc/zshrc
    Run for interactive shells.
  6. $ZDOTDIR/.zshrc
    Run for interactive shells.
  7. /etc/zlogin
    Run for login shells. (not present on my MBP)
  8. $ZDOTDIR/.zlogin
    Run for login shells.

/etc/zshenv and $ZDOTDIR/.zshenv

/etc/zshenv does not exist on macOS.

$ZDOTDIR/.zshenv is for user-defined env variables, it is run by every shell invocation. I added sourcing of .zprofile for non-interactive, non-login shells.

/etc/zprofile and $ZDOTDIR/.zprofile

/etc/zprofile on macOS executes

$ eval `/usr/libexec/path_helper -s`

that sets and exports the system-wide PATH and MANPATH

Diagram and possible generalization

The possible paths are:

  • ${\mathbf{\color{red}RED \longrightarrow}}$: login, interactive
  • ${\mathbf{\color{cyan}CYAN \longrightarrow}}$: login, non-interactive
  • ${\mathbf{\color{green}GREEN \longrightarrow}}$: non-login, interactive
  • ${\mathbf{\color{blue}BLUE \longrightarrow}}$: non-login, non-interactive

zsh startup

The above diagram has been inspired by this blog post and its companion repo. The post describes an interesting setup for covering multiple shell types.

Secretes

for now I keep a non version controlled file .secret_keys