In vi, I have mapped 'jj' to escape to be able to switch to command mode without using the annoying escape key. Now I want to have the same for command line editing for which I use vi-mode. I already have found the following solution:

bindkey '^j' vi-cmd-mode

lets you change with control-j into command mode. Still searching for a solution without modifier-keys as 'jj' or something similar.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

Note: You should look at man zshzle for a lot of goodies about customizing bindkey and emulating GNU readline.

This is how I mapped jj to Esc:

bindkey -M viins 'jj' vi-cmd-mode

If you're interested in distinguishing between insert-mode and normal-mode, you could try out the suggestion akira mentions here

link|improve this answer
yeah! works perfectly. thx alot! – Eman Resu Nov 6 '11 at 13:17
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.