如何在zsh中获得Bash的还原行

问题描述 投票:0回答:1

由于macOS默认更改为zsh,因此我尝试为其更新键盘绑定。

bash中,我可以使用以下命令:

bind '"\C-a": revert-line' # Revert/resets the changed history line while you are on it with the the cursor

我在zsh上找不到类似的功能。

bindkey "^a" what-to-put-here 

您知道如何用zsh完成它吗?

bash zsh key-bindings
1个回答
1
投票

revert-linereadline提供的功能。而ZSH并不依赖于readline。 ZSH在命令行中有自己的编辑器,称为ZLE(ZSH Line Editor)。

© www.soinside.com 2019 - 2024. All rights reserved.