开发者

Which shortcut in Zsh does the same as Ctrl-U in Bash?

开发者 https://www.devze.com 2023-01-11 08:00 出处:网络
In Bash, when I am typing a command, I press Ctrl+U, all characters from the beginning of the line to the cursor are going to be removed. However, in zsh, if I pressed Ctrl+U, the whole line is gone.

In Bash, when I am typing a command, I press Ctrl+U, all characters from the beginning of the line to the cursor are going to be removed. However, in zsh, if I pressed Ctrl+U, the whole line is gone.

How to d开发者_Go百科o the same in Zsh as in Bash?


It sounds like you'd like for Ctrl+U to be bound to backward-kill-line rather than kill-whole-line, so add this to your .zshrc:

bindkey \^U backward-kill-line

The bindkey builtin and the available editing commands (“widgets”) are documented in the zshzle man page.

0

精彩评论

暂无评论...
验证码 换一张
取 消