Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can this be done with compctl?
- X-seq: zsh-users 6722
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxxxxx>
- Subject: Re: Can this be done with compctl?
- Date: Tue, 21 Oct 2003 18:12:44 +0000
- In-reply-to: <20031018161752.GB17781@DervishD>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20031018161752.GB17781@DervishD>
On Oct 18, 6:17pm, DervishD wrote:
}
} I wanted to simulate the bash behaviour of completing command
} names if you hit TAB on an empty prompt [...] It seems that compctl
} don't even try to complete if there is not a word in the prompt :??
That's partly correct. TAB is magic in the old compctl system -- it
is *always* self-inserted when there is only whitespace at the prompt.
You can complete at an empty prompt by binding *another* character to
expand-or-complete (or any of the builtin completion widgets), but you
can't do so with a TAB unless you create a widget with "zle -C".
This can of course be as simple as
function x-or-c {
compstate[insert]="${compstate[insert]//tab /}"
compcall
}
zle -C expand-or-complete expand-or-complete x-or-c
(That is, override the builtin expand-or-complete, so no bindkey changes
are required.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author