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

Re: Completion in pwd before subdirecories

On Dec 13,  4:46pm, Jesper Holmberg wrote:
} In any case, suppose I have these files in a directory:
} dota1.pdf dota2.pdf dir
} where dir is a directory.
} If I now type xpdf d<tab>, zsh will suggest dir as the first completion.

Are you sure this isn't happening just because zsh presents the menu in
alphabetical order?

} I would prefer it if it tried it with any file matching in the current
} directory, before going into the sub directories. I would thus rather see
} dota1.pdf and dota2.pdf suggested before dir, in my example.
} Is this possible?

It depends on wheher you're using compsys or compctl.  Does your .zshrc
(or the /etc/z* files, I'm not familiar with Debian) contain

    autoload -U compinit

??  If not, you have almost no control over the sorting order.

If you are using compsys, then the group-order style is probably what
you want:

zstyle ':completion:*' group-name ''
zstyle ':completion:*' group-order files directories

Read "man zshcompsys" for descriptions of group-name and group-order.

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