1. 13
    1. 8

      Alternatively, one can use static named directory. It has the advantage of being expanded at any place, so it works with any command, not just with cd.

      1. 1

        Is this approach zsh only?

        1. 2

          Yes. AFAIK, bash does not have this.

      2. 1

        Wow! I had no idea such a thing existed. Definitely it looks like a more complete solution than mine, although also more complex. Still good to learn something new :)

      3. 1

        I also like the words of wisdom thar you can just use shell variables.

        https://vincent.bernat.ch/en/blog/2015-zsh-directory-bookmarks#fn-variables

        You only lose the prompt expansion.

    2. 4

      I use zoxide (from the autojump family of tools) and let my computer remember my frequently used directories for me.

      (AFAIK autojump inspired j inspired j2 inspired z inspired z.lua inspired zoxide.)

      1. 2

        I also use zoxide because it supports both Powershell and fish unlike many of its predecessors

    3. 2

      I’ve been using this solution with a slight modification,. It is basically the same idea, but creates custom commands instead of modifying CDPATH.