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 7871
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: ZSH User List <zsh-users@xxxxxxxxxx>
- Subject: Re: how to execute zle widget during zsh-init?
- Date: Mon, 16 Aug 2004 20:14:05 -0700 (PDT)
- In-reply-to: <20040816214627.GA32476@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20040816214627.GA32476@xxxxxxxxx>
- Reply-to: zsh-users@xxxxxxxxxx
On Mon, 16 Aug 2004, Andy Spiegl wrote:
> -------------
> # increase the size of zle kill ring to 30
>
> emulate -L zsh
>
> : ${NUMERIC:=30}
> while (( NUMERIC-- )); do killring+=(''); done
> -------------
That could be more compactly written as
grow-killring() {
setopt localoptions noksharrays
: ${killring[${NUMERIC:-30}]:=''}
}
Arrays automatically grow to accomodate the largest element into which you
store a value, even if you don't use the intervening elements.
> But now I can't find a practial way to "execute" it every time I start a
> new shell because it has to be done from inside zle. :-(
zle-line-init() {
zle grow-killring
zle -D zle-line-init
}
zle -N zle-line-init
Messages sorted by:
Reverse Date,
Date,
Thread,
Author