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

Re: ZSH's way to bind function to a key in a script?



Hi,

2011/3/9  <nix@xxxxxxxxxxxxxxxx>:
> Hi everyone. I was reading last night about "bindkey" etc. , and i could
> not get it working.
>
> #!/bin/zsh
>
> function foo () {
>
> echo "Foo ooo"
> }
>
> In this script, how to bind function "foo" to a key. So lets say i press
> the Space button and it should trigger foo?

zle -N foo
bindkey ' ' foo

Best regards,

-- 
Jérémie



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