Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: how to execute zle widget during zsh-init?
- X-seq: zsh-users 7875
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: Re: how to execute zle widget during zsh-init?
- Date: Tue, 17 Aug 2004 14:27:27 -0700 (PDT)
- In-reply-to: <20040817162221.GA1472@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040816214627.GA32476@xxxxxxxxx> <Pine.LNX.4.61.0408162006440.26310@xxxxxxxxxxxxxxxxxx> <20040817162221.GA1472@xxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Tue, 17 Aug 2004, Andy Spiegl wrote:
> but zle-line-init() is called every time zle starts, i.e. before a prompt
> is shown. Isn't that overkill? :-)
That's why I put "zle -D zle-line-init" in there. The widget executes
once (the first time zle initializes) and then ceases to be a widget, so
it never executes again.
> Besides that doubt I can't get it to work. I put the function
> zle-line-init into my .zshrc, but where do I put the definition of the
> function grow-killring?
I presumed you had that somewhere already, because of the implementation
you had included. I didn't know what you called it so I made up a name.
I supposed e.g. that you had pasted in the content of an autoload file.
The full solution (with apologies to others that this repeats most of my
previous post) could all be in .zshrc and would then look something like
grow-killring() {
setopt localoptions noksharrays
: ${killring[${NUMERIC:-30}]:=''}
}
zle -N grow-killring
zle-line-init() {
zle grow-killring
zle -D zle-line-init
}
zle -N zle-line-init
Messages sorted by:
Reverse Date,
Date,
Thread,
Author