Zsh has a better builtin solution.
hash -d x=/path/to/x
Then you can cd to there with just ~x
And use it in commands like ls ~x/whatever/