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

Re: Yank index



> On 20/05/2024 12:31 BST Marlon Richert <marlon.richert@xxxxxxxxx> wrote:
> Inside a ZLE widget, is there a way to get the kill ring index of> the
> active yank? Is it possible to move this index?

Looking at the code, I think it works in such a way that when you use
the special array $killring, available via the zsh/zleparameter module,
the first entry is the one most recently yanked, i.e. the killring you
see in the variable effectively cycles by itself.  (There is some
relationship between $killring and $CUTBUFFER --- I'm reading the code
as saying they can be manipulated independently, however.)

You can set killring=(...) and that similarly becomes the ring with the
first entry as if you'd just yanked it, so you can cycle through it just
by assigning the array in a different order.

However, I haven't tried this out, so I may be missing subtleties --- I
doubt this ever got thought through to the level of detail you're now
investigating.

pws




Messages sorted by: Reverse Date, Date, Thread, Author