在这个问题中,无与伦比的丹尼斯威廉姆森提到了如何将击键绑定到将在Bash shell后台运行的命令,bind -x
. 如何在 Zsh 中做同样的事情?
(我在zshzle
手册页中找不到它,但我可能忽略了它。
您可以使用
zle -M
在命令行下显示信息。例如:
.who() {
zle -M "$(who)"
}
# Create a new widget `who` that calls our function `.who`.
zle -N who .who
# Bind said widget to alt-shift-W.
bindkey '^[W' who