Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I bin a key sequence to ESC in zsh?

I wish to do the following

bindkey "jj" <esc>

but cannot find the code for the Esc key


share|improve this question
up vote 0 down vote accepted

Esc is ASCII 0x1B, so all of \e, \x1b or \033 should work.

share|improve this answer
Yes, but the bindkey only seems to allow you to bind to widgets. I did manage to solve this in the end by binding to vi-cmd-mode which is what I was trying to achieve. – mrwooster Jun 15 '11 at 10:27
I wonder if this will allow me to bind custom sequence like ;; to enter into the ZLE vi mode. Can you please provide me with full command for .zshrc to change binding? Thanks! – A B Mar 19 '13 at 17:56
@A.B: It's documented in man zshzle. It should work, but it might become quite annoying to type a lone ; as ZLE will not display it until you enter the next character. – grawity Mar 19 '13 at 19:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .