1

When I have two directories and I cd to aaa1:

$~ ls
aaa1  aaa2
$~ cd aaa1

Now if I want to cd to ../aaa2 and use completion:

$~/aaa1 cd ../a<TAB>
aaa1  aaa2

zsh is offering me same directory that I am in.

Is it possible to tell zsh completion to ignore the current directory in such situation, as it most likely makes no sense to change into same directory using cd ../aaa1?

1 Answer 1

3
zstyle ':completion:*' ignore-parents 'parent pwd directory'

See http://zsh.sourceforge.net/Doc/Release/Completion-System.html#index-ignore_002dparents_002c-completion-style


PS: You are so often asking Zsh completion questions, perhaps you might be interested in the zsh-autocomplete plugin. It ships with a very mature completion config (so you don't have to spend so much time fiddling) and adds IDE-style real-time type-ahead autocompletion to your command line.

1

You must log in to answer this question.

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