zsh-users
 help / color / mirror / code / Atom feed
* zle - keep state of the buffer on accept-and-hold or hold only part
@ 2020-07-28 10:30 Tomasz Pala
  2020-07-28 11:48 ` Daniel Shahaf
  0 siblings, 1 reply; 2+ messages in thread
From: Tomasz Pala @ 2020-07-28 10:30 UTC (permalink / raw)
  To: zsh-users

Hi there,

I wonder if it is possible to retain entire state of the command line
buffer on accept-and-hold, I'm looking especially for mark location
("^@" set-mark-command) and possibly the undo history.
Or hold only a part of the command line?


My usage scenario follows - consider having (not so) many files with similar
names, like date/counter-suffixed. I need to perform some operations on them,
one by one (the commands slightly differ, assume it's not scriptable
worthy), e.g.

[1] xsltproc style.xslt file_200701.xml [alt-a: accept-and-hold]
[2] xsltproc style.xslt file_200701.xml | grep -v some_spam [accept-and-hold]
[3] xsltproc style.xslt file_200701.xml | grep -i sth_interesting | actual command [accept-and-hold]

[1] xsltproc style.xslt file_200702.xml [accept-and-hold]
[2] xsltproc style.xslt file_200702.xml | grep -v something_other [...]


Now, I got the " | grep -i sth_interesting | actual command" in xterm
PRIMARY and insert it fast with alt-shift-insert - so the [3] line is
fine. The [2] line changes depending on xsltproc output, it's written
ad-hoc, no optimization can be made.


However, most of the time I'm wasting is on going back to the point:

xsltproc style.xslt file_2007 <- here.

I can set a mark (ctrl-space) and then kill entire region, but the mark
doesn't propagate to the buffer after accept-and-hold.



Alternatively, and ideally, I would like to set a mark for a
accept-and-hold to retain only preceeding part of the buffer, e.g.:

$ xsltproc style.xslt file_2007 [ctrl-space: set-mark-command] [tab
completion to select some files] | some commands [alt-a: accept-and-hold]
$ xsltproc style.xslt file_2007

TIA, best regards,
-- 
Tomasz Pala <gotar@pld-linux.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-28 11:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-28 10:30 zle - keep state of the buffer on accept-and-hold or hold only part Tomasz Pala
2020-07-28 11:48 ` Daniel Shahaf

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).