tags:

views:

45

answers:

1

hi,

i know this is probably a silly question. But i googled and searched here, didn't get answer.

in Bash, when I was typing a command, i press Ctrl+u, all characters from the beginning of the line to the cursor are gonna be removed. However, in zsh, if I pressed ctrl+u, the whole line is gone.

How to do the same in Zsh?

Thank you.

Kent

+1  A: 

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.

Gilles
Zsh doesn't use readline, instead it uses its own zle. So i am gonna customize the keybind. thanks!
Kent