- prezto is my preferred zsh framework.
Links
Add jog (previous commands in the directory) functionality to zsh with zsh-histdbhacks
– Source
execute common commands in directory in zshhacks
Add functions directory to zsh
In ~/.zshrc
Scripting
Arrays
Concatenating Arrays1
Diffing Arrays2
Subtraction
Intersection
Add keyboard shortcuts
The above would run git show
whenever Ctrl+f
is pressed. The flag
-s
stands for substitute, i.e. substitute Ctrl+f
for git show and
carriage return to execute \n
.
Startup order
There are system wide configs (/etc) and user specific (home directory):
file | when | |
---|---|---|
/etc/zshenv | always | |
~/.zshenv | usually | |
/etc/zprofile | login | |
~/.zprofile | login | |
/etc/zshrc | interactive | |
.zshrc | interactive | |
/etc/zlogin | login |
PATH and macOS load order
macOS has a path helper (/usr/libexec/path_helper
) that is run in
etc/zprofile which will modify PATH setup up that point. This means
that ~/.zshenv
may end up clobbered. The recommended cure is to place
PATH modifications in ~/.zshrc
. Unfortunately this runs counter to
other advice you may receive. For example, at one point spacemacs asked
for PATH configuration in ~.zshenv. Ultimately you may need to manage
some path work in both places depending on the problem being solved, and
/etc/paths(.d)
is an alternative (but apparently macOS specific).