- Make changes incrementally — one function or one logical change at a time
- Discuss proposed changes and get agreement before editing files
- Small diffs are easier to review; avoid batching unrelated changes
- Always use the
commit-commands:commitskill for all git commits
- Prefer
[[ ]]over[ ]for conditionals - Use arrays instead of strings when building commands — avoids
eval - Use
printinstead ofecho -efor escape sequences - Use
localto scope variables inside functions
- Use
(( $+commands[cmd] ))to test if an external executable exists in PATH$commandsis an associative array mapping command names to their paths- Documented in
zshmodules(1)under thezsh/parametermodule - Fast (hash table lookup), no subprocess, no output to suppress
- Use
whence cmd &>/dev/nullwhen you need to detect aliases, functions, or builtins — not just PATH executables
- Run
reload!to pick up changes in the current session - For completion changes, rebuild the cache first:
rm -f ~/.zcompdump && exec zsh