1

I just set my zsh to vi mode as I feel the word/WORD (w/b W/B) skip keybindings will help me work faster than plain ^a ^e in emacs binding mode. However, I'd like to set backspace=2 or set backspace=eol, start; I have this in my .nvimrc, and it's what I'm used to right now.

Is there any way to set this variable in zsh?

4

Bind the backspace key to backward-delete-char instead of vi-backward-delete-char.

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

You may want to bind other vi-* widgets to their non-vi- variant. Run bindkey -LM viins to list the insert mode keymap in a form you can tweak and copy to your .zshrc.

Alternatively, if the word motion commands are all that drives you to the vi map, you can map them in Emacs mode.

bindkey '^[B' vi-backward-blank-word
bindkey '^[E' vi-forward-blank-word-end
bindkey '^[F' vi-forward-blank-word
bindkey '^[b' vi-backward-word
bindkey '^[e' vi-forward-word-end
bindkey '^[f' vi-backward-blank-word

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.