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

Re: pushing a string in the cut&paste stack



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