Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I make control-u behavior be the same for ZSH as it is for Bash?

Tags:

bash

zsh

In Bash, control-u will clear from the curser to the beginning of the line, and put that text into the paste buffer, which can be pasted with control-y.

In Zsh, it will clear the text, but does not put it into the buffer.

sadness.

like image 728
John Bachir Avatar asked Dec 10 '10 02:12

John Bachir


1 Answers

This can be done really easily with just two bindkey commands:

bindkey '^U' backward-kill-line
bindkey '^Y' yank

It may be worth noting that at least '^Y' should be bound in the default Emacs keymap.

like image 150
fow Avatar answered Sep 28 '22 03:09

fow