Zsh: hash directory completion

oh-my-zshzsh

I have configured some directories alias via hash -d hashname=/path/to/directory command.
Completion for that aliases works for a long time like this:

% hashn<TAB> # becomes hashname, pressing <ENTER> works like cd /path/to/directory

Some times ago this has stopped to work. Now that aliases are completable only if starts with ~ sign:

% ~hashn<TAB> # only this works

Is there any way to get previous behaviour?

Best Answer

You had the options auto_cd and cdable_vars turned on. With auto_cd, if you type a directory as a command name, the cd command is implied. With cdable_vars, if a directory doesn't exist, or a command doesn't exist with auto_cd, then the name is looked up in the directory hash table.

As long as you're using the “new-style” (compinit) completion system, which oh-my-zsh turns on, the name will be offered as a completion when relevant.