zsh-users
 help / color / mirror / code / Atom feed
* Coloring completions
@ 2004-07-14 11:21 DervishD
  2004-07-15  3:27 ` Bart Schaefer
  0 siblings, 1 reply; 9+ messages in thread
From: DervishD @ 2004-07-14 11:21 UTC (permalink / raw)
  To: Zsh Users

    Hi all :)

    I'm playing with compsys, and I don't understand what happens
with coloring. I currently don't use the shell functions for
completion, I use compsys but 'naked' (resuming: I don't have any
compinit call in my RC's), and when I hit 'TAB' (which currently is
bound to 'expand-or-complete'), the completions appear colored
, and that's ok because I have zsh/complist loaded. The problem
appears when I do the following:

bindkey "^O" completer
zle -C completer expand-or-complete completer

function completer () {
    if [[ $words[1] == cd ]]
    then
        compadd -f *(/)
    else
        compadd -f *
    fi
}

    That's a stupid test to play with compsys. If I do the above,
when I hit '^O', depending on the first word only dirs or all files
are listed, but they are listed without coloring. I thought coloring
was automatic as long as zsh/complist was loaded. If I do the above
(remember: I don't use the compsys shell functions), do I need to
'color' de completion matches myself?

    If it is not long, boring or off-topic: could anyone explain me
how the shell functions given with compsys do the coloring or what
should I read first to understand how _main_complete et al. do the
coloring? Given that _main_complete is far complex that my crappy
function above ;) the principles should be the same and the
completion matches are generated by compadd calls, so the coloring is
done by some function or by compsys itself, am I wrong?

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Coloring completions
@ 2005-11-21 13:18 Nikolai Weibull
       [not found] ` <200511211902.46023.arvidjaar@mail.ru>
  0 siblings, 1 reply; 9+ messages in thread
From: Nikolai Weibull @ 2005-11-21 13:18 UTC (permalink / raw)
  To: ZSH Users

Is there any way to get colors in completions for something like files
in a tar archive?  Seeing as how it would be possible to tell if an
entry is a directory or not, it would be nice if it was highlighted like
directories on the filesystem are.  The same goes for files with the
executable bit set.

Thanks.

        nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-21 16:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-14 11:21 Coloring completions DervishD
2004-07-15  3:27 ` Bart Schaefer
2004-07-15 10:50   ` DervishD
2004-07-15 15:21     ` Bart Schaefer
2004-07-15 16:36       ` DervishD
2004-07-16  2:20         ` Bart Schaefer
2004-07-16  8:20           ` DervishD
2005-11-21 13:18 Nikolai Weibull
     [not found] ` <200511211902.46023.arvidjaar@mail.ru>
2005-11-21 16:12   ` Nikolai Weibull

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).