Tab completion of “../” in zsh

autocompletedirectoryoh-my-zshzsh

In bash, I can use tab-completion to move one directory up and descend down again another path. For example, suppose I'm in $HOME/folder1, and I want to cd to $HOME/folder2. $HOME only has the two child directories folder1 and folder2.

In bash, I could just type

cd ..[TAB]f[TAB]2

and would end up in $HOME/folder2. In my fresh zsh installation, pressing cd ..[TAB] produces a list of those child directories of $HOME/folder1 which have two . in their name.

Is there a simple way to get the behaviour I'm used to? Or is there something even easier to achieve what I want in zsh?

Best Answer

Add this to your .zshrc and ..[TAB] will complete to ../ as per bash.

zstyle ':completion:*' special-dirs true