zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: budikusasi@gmail.com
Cc: zsh-workers@zsh.org
Subject: Re: How Zsh bindkey -s work
Date: Mon, 15 May 2023 19:39:22 -0700	[thread overview]
Message-ID: <CAH+w=7YKJn26Z-2=iDGrOWEiMjxNxNCu-su+-+06L81mfSY0Bg@mail.gmail.com> (raw)
In-Reply-To: <sympa.1684112843.673070.38224.344@zsh.org>

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.


      reply	other threads:[~2023-05-16  2:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-15  1:09 budikusasi
2023-05-16  2:39 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7YKJn26Z-2=iDGrOWEiMjxNxNCu-su+-+06L81mfSY0Bg@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=budikusasi@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).