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

Re: Completion list question



On Mar 23,  3:56pm, Björn Lindström wrote:
} Subject: Completion list question
}
} How do I make zsh-3.1.9 show the completion possibilities in the
} style of 'ls -F'? I want this instead of color on my BSD box to
} make it consistent with BSD ls.

This is still accomplished by `setopt list_types' just like it was with
old completion.  With new completion, though, it'll only work in cases
where zsh "knows" that what it's completing are file names, which depends
on how the completion function called the `compadd' builtin.

(Really, this is true for old completion, too, but there aren't so many
ways using compctl to insert your own set of matching strings into the
list, so it's harder to forget to tell zsh what is a file.)

To turn off colors, make sure that the `list-colors' style is NOT set,
that you are NOT using "menu selection" (the `menu' style with a value
containing `select=...', nor the menu-select widget bound to a key, and
probably several other things besides), and lastly that the zsh/complist
module is NOT loaded.

It's probably a bug (Sven?) that it's not possible to use menu selection
without getting color listings as well.

On Mar 23,  4:42pm, Alisdair McDiarmid wrote:
} Subject: Re: Completion list question
}
} On a similar note, how do I make zsh 3.1.9 show the completion
} possiblities in colour?

To begin with, your terminal type has to be one that supports color.  If
that's not a problem, then the quickest way is

    zmodload -i zsh/complist
    zstyle ':completion:*' list-colors ''

to use zsh's default colors (which are the same as GNU ls's defaults).
If you use the LS_COLORS environment variable to customize GNU ls, then
you probably want

    zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}

which is the example from the manual under the list-colors style.  See
therein for more information.

The caveats above about zsh needing to know what's a file and what is
not also apply to colored listings, but there are zstyles to get zsh to
color matches that aren't known to be files.  See the manual under the
list-colors style and the ZLS_COLORS parameter.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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