Post

Replies

Boosts

Views

Activity

Reply to zsh alias that take a variable and expands it.
If you need to switch between directories faster, then I want to recommend zsh-z plugin – a command-line tool that allows you to jump quickly to directories that you have visited frequently in the past or recently. As for the problem with $($1), I think it is an artificial problem in general. You already exported your project paths as environment variables (with export dir1="..."), so use them appropriately (e.g., showdir $1). You will get zsh's autocomplete for free for environment variables and can always type showdir $ then press TAB to see all the projects you have. Also, a small recommendation, do not mess up with PWD within scripts and try to avoid direct cd commands. pushd/popd are better and more flexible.
Jun ’21