Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

My Emacs keybindings in zsh are not working (CtrlA, CtrlE). I use zsh on OS X.

They might be bound to some other thing. I'm currently using oh-my-zsh.

And my .zshrc is over here.

share|improve this question

migrated from Dec 24 '12 at 2:37

This question came from our site for professional and enthusiast programmers.

@rene Done! thx for the advice! :D – Takehiro Adachi Dec 24 '12 at 16:52
From the screenshot I gather you are on Mac OS X? I have the same problem there in terminal. Ctrl+A/E/K are already taken in that OS (for use in text fields in the GUI), which might explain this. – Henno Dec 25 '12 at 5:35
@Henno really? Im using zsh atm, and when i use bash, the ctrl+a(go to the first char of line) and ctrl+e(go to the end of the line) works fine. but when i use zsh, it goes like the screenshot. so i think its an problem about zsh, not the OS :( – Takehiro Adachi Dec 25 '12 at 9:42
@TakehiroAdachi your fixed worked for me too! – Henno Dec 26 '12 at 18:13
@Henno Great :D! – Takehiro Adachi Dec 27 '12 at 6:40
up vote 12 down vote accepted

I got the problem solved. Looks like oh-my-zsh was overriding the default keybindings.

When I added the below line at the end of my .zshrc, CtrlE and CtrlA worked:

bindkey -e
share|improve this answer
great, worked for me too! – Henno Dec 26 '12 at 18:13

You can find out what codes you need by typing CtrlV CtrlA and CtrlV CtrlE.

Then you can put the code in your .inputrc, the system /etc/inputrc, or your zshrc like this:

bindkey '^A' beginning-of-line
bindkey '^E' end-of-line

This works for other keys too. For instance, I had some trouble with Home and End.

You should be able to use this trick in any terminal session : tty,

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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