Czipperz
Czipperz

Reputation: 3336

Rebind normal mode controls vi zsh

I rebind the hjkl movement scheme to jkl; in vim / evil mode and want to figure out how to do this in zsh as well. I tried the following but it doesn't seem to do anything:

bindkey '\ej' backward-char
bindkey '\e;' forward-char
bindkey '\ek' down-history
bindkey '\el' up-history

Does anyone know the command names to do this and how to use normal mode binds?

In addition, how do I bind h to what is normally ;?

Upvotes: 1

Views: 969

Answers (1)

chepner
chepner

Reputation: 531808

I think you want the following:

# Add bindings to the vicmd keymap
bindkey -a j backward-char
bindkey -a ';' forward-char
bindkey -a k down-history
bindkey -a l up-history

I'm not entirely sure how to copy a key binding, but since ; is bound to vi-repeat-find by default, you can add

bindkey -a h vi-repeat-find

Upvotes: 2

Related Questions