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

Can this be done with compctl?

    Hi all :))

    I wanted to simulate the bash behaviour of completing command
names if you hit TAB on an empty prompt, and my first try was using
compsys (I'll use compsys for naming the new completion system). I
don't use the provided set of functions (_main_complete based), so I
do something like:

    completer () {
        compadd -a commands -k functions builtins aliases galiases
    zle -C complete expand-or-complete completer
    bindkey "^O" complete

    This is just a test for showing more or less what I want:
obviously a better and more ellaborated solution should be written,
but this is not the point. The question is that I would like to do
something similar with compctl. I've tried, with no success, things

    compctl -T -x 'p[0]' -c - --
    compctl -T -x 'm[0]' -c - --

    or similar commands using empty command names instead of '-T'
(which, BTW, should not be used for that...). It seems that compctl
don't even try to complete if there is not a word in the prompt :??

    Anyone can help?

    Although as I told in the past, default completion (no compsys,
no compctl) fulfills 98% of my needs, and compctl will do for a
couple of commands I want specially completed, I must confess that
compsys is more comfortable for defining some completions, even
without _arguments or things like that.

    Thanks a lot in advance.

    Raúl Núñez de Arenas Coronado

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

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