* Predefine the next buffer
@ 2021-05-09 19:11 Michel
2021-05-09 20:02 ` Peter Stephenson
0 siblings, 1 reply; 3+ messages in thread
From: Michel @ 2021-05-09 19:11 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
Hi,
I try to have that will define the next content of my buffer. For example:
I run a command 'foo' and the next command will be pre-write with 'bar' (or
replace 'foo' by 'bar'). I imagine made it with a function, but I can't use
zle to manipulate the buffer, it seems to be required to use a widget and
run it from a shortcut.
Anyone have already tried this? Do you know how I can make it?
Thanks
_____________________
Michel BARRET
[-- Attachment #2: Type: text/html, Size: 678 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Predefine the next buffer
2021-05-09 19:11 Predefine the next buffer Michel
@ 2021-05-09 20:02 ` Peter Stephenson
2021-05-09 20:53 ` Michel
0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2021-05-09 20:02 UTC (permalink / raw)
To: zsh-workers
On Sun, 2021-05-09 at 21:11 +0200, Michel wrote:
> I try to have that will define the next content of my buffer. For
> example: I run a command 'foo' and the next command will be pre-write
> with 'bar' (or replace 'foo' by 'bar'). I imagine made it with a
> function, but I can't use zle to manipulate the buffer, it seems to be
> required to use a widget and run it from a shortcut.
So "foo" is something like a shell function thatʼs going to do some
stuff, and you want it also to set up the next editing command line for
you?
Try this:
foo() {
print -z bar
}
(BTW user questions really belong on zsh-users.)
pws
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Predefine the next buffer
2021-05-09 20:02 ` Peter Stephenson
@ 2021-05-09 20:53 ` Michel
0 siblings, 0 replies; 3+ messages in thread
From: Michel @ 2021-05-09 20:53 UTC (permalink / raw)
To: Peter Stephenson; +Cc: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 365 bytes --]
> So "foo" is something like a shell function thatʼs going to do some
> stuff, and you want it also to set up the next editing command line for
> you?
>
> Try this:
>
> foo() {
> print -z bar
> }
>
Exactly this! Thank you very much.
(BTW user questions really belong on zsh-users.)
>
Sorry I'm not sure
_____________________
Michel BARRET
[-- Attachment #2: Type: text/html, Size: 859 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-09 20:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-09 19:11 Predefine the next buffer Michel
2021-05-09 20:02 ` Peter Stephenson
2021-05-09 20:53 ` Michel
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).