Skip to content

Sharing back zshrc.d trick #14

@RayJameson

Description

@RayJameson

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions