On Thu, Jun 08, 2000 at 04:34:37PM +0200, Matthias Kopfermann <kopfermann@xxxxxxxxxxxxxxxx> wrote: > > Okay, after having heard the answer that there is the possibility > to have colored completion, has anybody used it to create useful > completions with colors in them to share with us all? > There is not one example but the very easy to handle > ZLS_COLOURS case for completing different kinds of files. > To me it still seems to be quite complex to say the least. Well... I have a bit of stuff for ssh, but not too much else: setopt autolist ZLS_COLOURS="no=36;40:fi=36;40:di=32;40:ln=36;40:pi=31;40:so=22;40:bd=44;37:cd=44;37:ex=35;40:mi=36;40:lc=\e[:rc=m:ec=:mi=37;41" export ZLS_COLOURS LS_COLORS=$ZLS_COLOURS export LS_COLORS ZLS_COLOURS="$ZLS_COLOURS:(hosts)=(#b)(*).(mayn.de)=36;40=31;40" # real fun ZLS_COLOURS="$ZLS_COLOURS:(hosts)=*=33;40" # hostnames in yellow ZLS_COLOURS="$ZLS_COLOURS:(users)=*=32;40" # users in green export ZLS_COLOURS # no 0 for normal text (i.e. when displaying something # other than a matched file) # fi 0 for regular files # di 32 for directories # ln 36 for symbolic links # pi 31 for named pipes (FIFOs) # so 33 for sockets # bd 44;37 # for block devices # cd 44;37 # for character devices # ex 35 for executable files # mi none # for non-existent file (default is the value defined # for fi) # lc \e[ for the left code (see below) # rc m for the right code # ec none # for the end code autoload -U compinit compinit zstyle ':completion:*' completer '_complete' '_correct' '_approximate' zmodload complist # ( in my .zshrc, there are more hosts ;-) zstyle '*' hosts 'imbus.mayn.de' 'datenbus.mayn.de' 'willkuere.informatik.uni-wuerzburg.de' 'picard.franken.de' zstyle '*' users thomas tkoehler koehlert jean-luc root captain zstyle ':completion:*' group-name '' > Okay, I try to be not so polite: :) > Should'nt there be an easier way than that approach? Well - at first, it seems not too obvious that there are predefined names for "normal file", "directory", "symbolic link" etc, but none for things like "hostnames", "usernames" etc... CU, Thomas -- Thomas Köhler Email: jean-luc@xxxxxxxxxxxxxxxxx | LCARS - Linux <>< WWW: http://jeanluc-picard.de | for Computers IRC: jeanluc | on All Real PGP public key available from Homepage! | Starships
Attachment:
pgp1kqFHieUUe.pgp
Description: PGP signature