Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [vi-mode] mapping <esc> (`\e') in visual mode in zsl vi-mode



Filipe Silva wrote:
>
> How can I bind the <ESC> key, in zle vi-mode visual mode? I want that
> pressing <esc> in visual mode switches to vi-normal mode.
>
> this does not work:
>
> bindkey -M visual '\e' vi-cmd-mode

A deactivate-region widget was added in 5.1 so you must be using 5.0.8.

If you're stuck with 5.0.8, you can define your own:
  deactivate-region() {
      REGION_ACTIVE=0
  }
  zle -N deactivate-region
  bindkey -M visual '\e' deactivate-region

Otherwise, I'd recommend upgrading.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author