Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Ignore commands if autocomplete to directory is possible

I am an old loyal user of ZSH but this is my first community mail. Pardon
me for any errors.

I am using setopt auto_cd. But when autocompleting for directories, i want
that first preference is to be given to directories than to commands. Which
means, if directory is present that matches the substring then zsh should
not search for commands.

For examples, if i type 'ex' and then press <tab> and an 'examples'
directory was present it should get autocompleted. If 'examples' directory
is not there, then it should options for 'exit' 'exec' etc commands. This
would make cd'ing to directories much more faster.

There should be some neat zstyle completion for this, but i am not able to
figure that out. Closest related thread was : disable substring match on
command name <http://www.zsh.org/mla/users/2014/msg00279.html>. But it was
hard for me to tweak it to my needs.

Is there some good completion style possible for this?

PS: My completion zstyle is currently using oh-my-zsh's

Prateek Agarwal
MSCS, UT Austin

Messages sorted by: Reverse Date, Date, Thread, Author