zsh-workers
 help / color / mirror / code / Atom feed
* How Zsh bindkey -s work
@ 2023-05-15  1:09 budikusasi
  2023-05-16  2:39 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: budikusasi @ 2023-05-15  1:09 UTC (permalink / raw)
  To: zsh-workers

How Zsh bindkey -s mechanism as it cannot normally work for content of $
( ... ) i.e. interprocess syntax ?

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

* Re: How Zsh bindkey -s work
  2023-05-15  1:09 How Zsh bindkey -s work budikusasi
@ 2023-05-16  2:39 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2023-05-16  2:39 UTC (permalink / raw)
  To: budikusasi; +Cc: zsh-workers

On Sun, May 14, 2023 at 6:09 PM <budikusasi@gmail.com> wrote:
>
> How Zsh bindkey -s mechanism as it cannot normally work for content of $
> ( ... ) i.e. interprocess syntax ?

This sounds more like a zsh-users question than -workers, but:

I'm not sure what you mean here.  I'm going guess that you're
expecting to be able to do something like

bindkey -s $'\e[15~' '$(<somefile)'

and thereby have the contents of somefile inserted into the command
line (or some similar thing) when you press F5.

This isn't what bindkey -s is meant to do.  It's a keyboard shortcut
mechanism, to replace one set of keystrokes with another.  The
replacement set is then also interpreted as if typed, etc.

What you (seem to, I may be guessing wrong) want is accomplished with
the widget mechanism.

function insert_somefile {
  LBUFFFER+=$(<somefile)
}
zle -N insert_somefile
bindkey $'\e[15~' insert_somefile

If this doesn't resemble what you're after, you'll have to ask a more
specific question.


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

end of thread, other threads:[~2023-05-16  2:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-15  1:09 How Zsh bindkey -s work budikusasi
2023-05-16  2:39 ` Bart Schaefer

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).