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

Re: Shift-Insert overwrites ZLE CUTBUFFER



On 10 Nov, Bart wrote:
> emacs.  So yes, emacs does have a whole suite of register operations,
> none of which are present in zsh (which in fairness was based on a

Would it be useful to add some of those operations given that it
might share much of the existing code that's there for vi (given a
few compromises)?

Coming back to the original point of this thread, would it make
sense to instead put the bracketed-paste text in a register? (g)Vim's
nearest equivalents are "* for the X selection, "+ for secondary
selection and "~ which allows drag and drop. I wonder that if we
want "*, it'd be better handled by allowing external commands like
xclip, xsel or pbcopy to be hooked in. Maybe "~ then? Emacs allows
basically any character to be used for a register which wouldn't
really allow for any special ones unless we ignore that.

With the paste in a register, we might want at least the emacs
insert-register widget along with copy-to-register. Frustratingly,
emacs' insert-register leaves the cursor to the left of the inserted
text making it less suitable as i_Ctrl-R in vim.

Both emacs and vi use the registers for storing macros. I don't
really miss macros in zsh (and have bound q to something else) but
bash has them. Storing a POINT is analagous to a vi mark. In zsh,
I find vi marks are mostly useful for bookmarking history lines and
it'd seem reasonable to offer that for emacs mode too. marks are
stored separately from buffers but I'm not sure that the separate
namespace would really matter.

> change them.  As a thought, could use the terms "killring buffer" for
> 1-9 and "register buffer" for a-z, when updating documentation.

I quite like that. Would mean that anyone searching for either register
or buffer would find what they're looking for.

> (Although it's possible to expand the killring to more than 9 elements
> by assigning directly to the variable.)

> Aside: If the numbered registers duplicate $killring, how is it there
> are 9 numbered registers but the killring defaults to only 8 elements?

Actually it seems the numbered vi buffers are quite separate from the
killring and there are slightly different rules about what goes into
them. So I should probably put the numbered registers in the registers
special parameter after all.

> The parameters are created before the function for any user-defined
> widget is called, but are defined as being local to the scope of the

That makes sense. Thanks

Oliver



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