Hello! I like your dotfiles, I borrowed some cool things you have there, like command_exists function for zsh checks and zshrc.d directory for splitting up config, so I decided to share back with you a cool trick.
I've noticed you have hardcoded sources in your zshrc and you have this one at the top so rest of the file can use the command_exists function.
I've seen people include numbers in their *.d files, it's very useful, because if you do that and source all files in a loop over glob, the sourcing will be in sorted order from lowest number to highest. I also utilize this trick, so I don't have to hardcode anything and at the same time I'm confident that sourcing order will be persistent. For example, 05-utils.zsh will be sourced first.
This is how *.d files are sourced
Best of luck!
Hello! I like your dotfiles, I borrowed some cool things you have there, like
command_existsfunction for zsh checks andzshrc.ddirectory for splitting up config, so I decided to share back with you a cool trick.I've noticed you have hardcoded sources in your
zshrcand you have this one at the top so rest of the file can use thecommand_existsfunction.I've seen people include numbers in their
*.dfiles, it's very useful, because if you do that and source all files in a loop over glob, the sourcing will be in sorted order from lowest number to highest. I also utilize this trick, so I don't have to hardcode anything and at the same time I'm confident that sourcing order will be persistent. For example,05-utils.zshwill be sourced first.This is how
*.dfiles are sourcedBest of luck!