Type cd my-work-repo-1 from anywhere and land in ~/Documents/work/my-work-repo-1. zsh's cdpath is one of my most used zsh features and I noticed how much I missed it when my new machine didn't have it set up.

cdpath lets you change directory to any child directory in those paths, so I set all my work folders, local project folders, and config folders to it:

# NOTE: obeys listed order in case of duplicate folders,
# so it checks the local dir, `.`, first
cdpath=(. ~/Documents/work ~/Documents/projects ~/.config)

Now I can type cd my-work-repo-1 from any directory and switch to ~/Documents/work/my-work-repo-1. This becomes handy with lots of separate folders of projects. A very common use case for me is to quickly switch to config folders to edit something (cd zsh) and then switch back to the previous folder (cd -).

I also combine this with setopt autocd so that if a directory is typed on its own without cd it'd change to it, e.g.: my-work-repo-1. (Note, if that directory is also a command like zsh, I'd have to type cd zsh (for ~/.config/zsh) otherwise it'd just run zsh again inside the zsh pane.)

This is also useful to quickly scan all your projects with tab completion. For example, I can pull up a quick list of some typescript example projects by typing ts<tab>:

zsh output of tab completion from typing `ts` followed by `<tab>`, listing several directories