zsh - bindkey vi-cmd-mode causes other bindings to be unrecognized after exiting command mode -


i in zsh, , have used bindkey -v use vi key mappings in zsh. use <c-w> delete previous word, when type <esc> go normal mode/vi-cmd-mode, go insert mode i or a, can no longer use bindings <c-w> until run new command. there anyway can still use bindings bindkey after going normal mode insert mode? thanks!

this output of bindkey:

"^a"-"^c" self-insert "^d" list-choices "^e" "^[a ^[dbxxa" "^f" self-insert "^g" list-expand "^h" vi-backward-delete-char "^i" expand-or-complete "^j" accept-line "^k" self-insert "^l" clear-screen "^m" accept-line "^n"-"^p" self-insert "^q" vi-quoted-insert "^r" redisplay "^s"-"^t" self-insert "^u" vi-kill-line "^v" vi-quoted-insert "^w" vi-backward-kill-word "^x"-"^z" self-insert "^[" vi-cmd-mode "^[oa" up-line-or-search "^[ob" down-line-or-search "^[oc" vi-forward-char "^[od" vi-backward-char "^[[a" up-line-or-history "^[[b" down-line-or-history "^[[c" vi-forward-char "^[[d" vi-backward-char "^\\\\"-"~" self-insert "^?" vi-backward-delete-char "\m-^@"-"\m-^?" self-insert 

the widget vi-backward-kill-word (which default bound control+w in vi-ins mode) deletes point last entered insert mode. seems not working when not enter more text.

an easy workaround use widget backward-kill-word instead. can remap key binding control+w (this needs done after bindkey -v):

bindkey -v bindkey '^w' backward-kill-word 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -