由于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
完成它吗?
revert-line
是readline
提供的功能。而ZSH并不依赖于readline
。 ZSH在命令行中有自己的编辑器,称为ZLE(ZSH Line Editor)。