Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: pushing a string in the cut&paste stack
- X-seq: zsh-users 11403
- From: "Giulio Bottazzi" <giulio.bottazzi@xxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxx>
- Subject: Re: pushing a string in the cut&paste stack
- Date: Mon, 16 Apr 2007 16:17:29 +0200
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=JL7l6C7+wrGjrMTH0jYZcY7VR6jvhDUnI06zS4WnZIxdtlLONHHzXJgU5fZsg4S+Kjtm/3j/x6YNg/moCKte9F/ogYZEJ0wsc1BB/oMPdMerBdf8/mWeOuTtc2BjfCSzeHr/8fySrb9NTLbPrrY6f5R+Euc0KBwH2fvb6UDn73Y=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=XFHOHYJdCh/Hua86CPmHIQsVLtjqHHil5uGXAuuWnMTycFLZbCwonBLvTXTvfdhKXVcQD39XVGKtpp8/6fv9GSdDngyqMN9S1OqWbLRStJaTPKem5UI9M3TBsfipZGqfR/zVG/S9YkI0iUagTecd5dNkVJ8lL6mfFcm5/p/tpss=
- In-reply-to: <200704161255.l3GCtKF5011374@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <9fda5e550704160530p7e478483i4e8021a9e199ce23@xxxxxxxxxxxxxx> <200704161255.l3GCtKF5011374@xxxxxxxxxxxxxx>
Hi Peter,
thanks a lot! Your suggestion is exactly what I was looking for. After
a bit of studying, I would say that the killring-wise implementation
should be something like
zle-line-init () {
if [[ -n $copy_this ]]
then
killring=("$CUTBUFFER" "${(@)killring[1,-2]}")
CUTBUFFER=$copy_this
copy_this=
fi
}
Regards,
Giulio.
If you want to manipulate the editing stack (save the old value of the
the cut buffer onto the kill ring in the way the kill commands do) you
will need to use the array kill_ring. See the function kill-word-match
distributed with the shell for an example. (One day I should make it so
that copy-region-as-kill can take a string argument when called from an
editor widget.)
--
Giulio Bottazzi <giulio.bottazzi@xxxxxxxxx>
http://giulio.bottazzi.googlepages.com
PGP Key ID:BAB0A33F
Messages sorted by:
Reverse Date,
Date,
Thread,
Author