2

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?

2

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) – Amelio Vazquez-Reina Jan 30 '13 at 22:24
  • 1
    zsh 5.0.2 here and completion works with symbolic links pointing to directories on nfs and sshfs shares. – Endre Szabo Jan 30 '13 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 – Amelio Vazquez-Reina Jan 30 '13 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.