Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Can't use bindkey -c
- X-seq: zsh-users 757
- From: Zefram <zefram@xxxxxxxxxxxxxxxxx>
- To: stephen.talley@xxxxxxxxxxxxxxx (Steve Talley)
- Subject: Re: Can't use bindkey -c
- Date: Mon, 24 Mar 1997 18:42:09 +0000 (GMT)
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <199703221940.MAA01919@xxxxxxxxxxxxxxxxxxxxxx> from "Steve Talley" at Mar 22, 97 12:40:32 pm
Steve Talley wrote:
>Does zsh's "bindkey" allow the same functionality as tcsh's "bindkey
>-c"? This allows a keystroke to be bound to a builtin or external
>command instead of an editor command. This is useful when I'd like to
>run a command and see it's output without having to destroy the
>contents of the command-line buffer.
Apart from the method that Peter has posted, if you have version 3.1.1
and have applied the patches that have been posted recently, the following
can be done:
bindkey "^P" run-pwd
zle -N run-pwd
function run-pwd {
echo
pwd
zle redisplay
}
Presumably that patch will be in 3.1.2. In a later version, there will
be a slightly more general solution, probably looking something like:
zle -N run-command
function run-command {
zle trash-zle
eval "$STACK"
zle -s
}
bindkey -x "^P" run-command pwd
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author