3

I am using zsh and I always were able to cd right into paths that are part of my CDPATH configuration but, starting a few days ago, the completion stopped working.

mbp:~ $ echo $CDPATH
/Users/fcoury/Projects:/Users/fcoury:/Users/fcoury/code

CDPATH is still working:

mbp:~ $ pwd
/Users/fcoury
mbp:~ $ cd rackapp
~/Projects/rackapp
mbp:rackapp(master) $ pwd
/Users/fcoury/Projects/rackapp

But if I do cd rack and hit tab, no suggestions appear. Before, it would show all subdirectories of either ~/Projects, ~/code or ~ that would match "rack*".

Any ideas of what could have happened?

2
  • I discovered this just stopped working for me as well. Are you using Oh My ZSH? I am and am wondering if that is the link.
    – localshred
    Dec 10, 2012 at 21:02
  • Yes I am @localshred, but I don't remember updating it...
    – kolrie
    Dec 11, 2012 at 0:23

2 Answers 2

1

try adding

typeset -U path cdpath fpath

to the bottom of your .zshrc/.zshenv file, as that worked for me.

1
  • 5
    This works, but...why? I'm looking it up, but a bit of explanation would be helpful. Jan 21, 2013 at 12:41
0

Try adding this to your .zshrc:

zstyle ':completion:*:complete:(cd|pushd):*' tag-order \
'local-directories named-directories path-directories'

path-directories are directories from CDPATH, which the command above adds to zsh's completion for cd/pushd. This is from: this answer.

You must log in to answer this question.

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