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

Explicit colons in zstyle



Is there something special about how a style should be expressed when
it relates to "completer"?. I started noticing in some examples from
The Book, that completer is not treated exactly the same as other
styles.

Here's the well know most-recent-file example:

zstyle ':completion:most-recent-file::::' completer _menu _files _match
zstyle ':completion:most-recent-file:*' file-sort modification
zstyle ':completion:most-recent-file:*' hidden all
zstyle ':completion:most-recent-file:*' file-patterns '*(.):normal\ files'

Is there a reason why the first line contains so many colons? To me it
looks like it would be equivalent to the other lines, containing an
asterisk.

The same pattern in the next example:

zstyle ':completion:history-complete::::' completer _history
zstyle ':completion:history-complete:*' remove-all-dups true
zstyle ':completion:history-complete:*' sort true


Then, I saw this, also from The Book:

zstyle ':completion::*:::' completer _complete _prefix

The text says that the asterisk is necessary to make the _prefix
completer match, but I can't understand why the simpler "zstyle
':completion:*' completer _complete _prefix" wouldn't work.

I'm obviously missing something. Perhaps someone can enlighten me?



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