Say I have a folder parent with a subfolder, subfolder and a symbolic link symbolic_link.

I noticed that if my current working directory subfolder and I try to do cd ../sym[TAB], it will not autocomplete to cd ../symbolic_link.

How can I enable this type of autocompletion in Zsh?

1 Answer 1


zsh will autocomplete a symlink for cd if it points to a valid directory.

parent $ ls -l ../symbolic_link 
lrwxrwxrwx 1 e users 1 Jan 30 23:19 ../symbolic_link -> /
parent $ cd ../symbolic_link/
                 ^^ [TAB] pressed here
parent $ ln -s /asdf ../wrong_symbolic_link
parent $ cd ../wr
                 ^^ [TAB] sound the bell here
  • Hmm, I wonder if the reason why it doesn't work for me is because my symlinks point to paths mounted on different machines on the network. It's certainly not working for me (working with ZSH 5.02) Jan 30, 2013 at 22:24
  • 1
    zsh 5.0.2 here and completion works with symbolic links pointing to directories on nfs and sshfs shares. Jan 30, 2013 at 22:27
  • Thanks a lot Endre ... I will investigate this on my side. It looks like it works in some places for me too. hmm Jan 30, 2013 at 22:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .