7

I'm using zsh in vi-mode.

When I go to normal mode with ESC and then back into insert mode (for example using i, a or s), the line editor kind of "protects" the part of the line in front of the char, at which I was when re-entering insert mode.

I fixed it for the backspace char by rebinding it with

bindkey "^?" backward-delete-char

But there are still other bindings like ^W that don't work out of the box (probably because they are bound to vi-*).

If I understand it correctly, this behavior is normal to vi.

Is there's a way to make zle behave like vim without having to rebind so many keys?

polym
  • 10,672
  • 9
  • 41
  • 65
groxxda
  • 1,028
  • 1
  • 7
  • 11

1 Answers1

3

AFAICT, the only problematic widgets are:

vi-backward-delete-char
vi-kill-line
vi-backward-kill-word

So you could do

zle -A kill-whole-line vi-kill-line
zle -A backward-kill-word vi-backward-kill-word
zle -A backward-delete-char vi-backward-delete-char
Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501