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

Re: Shift-Insert overwrites ZLE CUTBUFFER

On Nov 10,  5:21pm, Oliver Kiddle wrote:
} Does emacs perhaps have anything analagous to the vi buffers? (It
} appears to be a vim thing to call them registers as I've been doing).

IIRC vi called them buffers and vim borrowed the term register from
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
much older version of emacs and for obvious reasons hasn't attempted
to track anything but the most straightforward editing operations).

You can of course use zsh's vi buffer operations as a simple subset
of emacs register commands.  As with vi, emacs registers are named
by a single character.  There are some special-case operations for
treating registers as values for POINT (zsh CURSOR) and incrementing
or decrementing numbers stored in registers, etc.

A useful addition to zsh/zleparameter would be a special hash of
register-to-content mappings (emacs calls this register-alist).

} Would there be any sense in putting it in the kill ring but not in
} the CUTBUFFER so yank-pop is needed to grab it.

That'd be a little strange in that it changes the order of the kill
ring with respect to the two most recent kills.  It also makes it a
bit more confusing for a user-definded widget to access the content
of the last paste if for some reason it was wanted, but not much.


    if [[ $LASTWIDGET == *bracketed-paste ]]
	# Used to be in $CUTBUFFER but now
	local pasted_text=$killring[1]
	# ...

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