zshzsh-zle

How to correctly bind `<esc>` in zle vi visual mode in zsh 5.0.8


The standard behaviour of <ESC> zle vi-mode when in visual mode is to do nothing. But I want that the action of pressing <esc> in vi-mode visual mode switches the keymap to vi-normal mode (vicmd). As it does in standard vi.

I tried this:

bindkey -M visual '\e' vi-cmd-mode

but it did not work.

This is the vi-mode configuration file that I'm using

how can I achieve the desired behaviour?


Solution