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

Re: Hiding Zsh bindkey -s echo of commands



On Wed, Aug 16, 2023 at 4:00 PM Budi <budikusasi@xxxxxxxxx> wrote:
>
> How to hide Zsh bindkey -s group of commands echos when being invoked,
> so this'd behave or perform like Bash' bind -x ?

Something like this should do it:

    function bind-x() {
      local widget=bind-x-widget-$2
      functions[$widget]='zle -I; '$2' <"$TTY"'
      zle -N "$widget"
      bindkey "$1" "$widget"
    }

    # Readline equivalent: bind -x '"\C-T": echo hello'
    bind-x '^T' 'echo hello'

Roman.




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