Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want Zsh to display all files when using tab completion after cd.

Right now tab completion after cd only display directories. I want to see all the files.

Basically i want it to work the exact same way as if i would use tab completion after a command like vim.

share|improve this question
why do you want to list 'files' when cd works only on directories? – akira Dec 2 '11 at 16:49
I want to always be aware about what files i have and where they are. Just because i'm going to use cd doesn't mean i know exactly where i'm going or what i'm looking for. – ggustafsson Dec 2 '11 at 21:00
but if you start with cd a filename is the wrong endpoint, imho. – akira Dec 3 '11 at 5:16
I don't care. It would however be pretty awesome if Zsh only displayed the files and ignored them when completing. – ggustafsson Dec 3 '11 at 7:51
up vote 1 down vote accepted

Edit: got the answer from ft on #zsh @ FreeNode.

compdef _path_files cd
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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