Backspace in zsh stuck

zlezsh

In set -o vi mode in bash, when I press Esc+k to get the last entered command, and then A, I end up in the insert mode, which allows me to press backspace to start deleting the end of the last command.

With zsh in set -o vi mode, everything works up until the backspace part.

How can I fix this?

Best Answer

The quick answer, put this in your ~/.zshrc:

bindkey -v '^?' backward-delete-char

Normally '^?' (backspace) is bound to vi-backward-delete-char, which is supposed to have the behavior you observe, as that is how vi (not vim, unless in vi classic mode) behaves.

Related Question