Chao Sun

Emacs bindings for iTerm under OSX

Posted on May 22, 2016 by Chao Sun

Since switching to iTerm I’ve been annoyed by the fact that it doesn’t support common Emacs keybindings, such as forward/backword word, deleting a word ahead, and so on. Today I finally decided to fix this, and here’s how to do it:

  1. First go to iTerm -> Preference -> Profiles -> Keys, and then click the “+” sign.
  2. Then, add the following keybindings:
  1. For “Forward a word”, choose “Send Escape Sequence”. For the “Esc+”, type in “f”.
  2. For “Backward a word”, also choose “Send Escape Sequence”. For the “Esc+”, type in “b”
  3. For “Delete a word ahead”, choose “Send Escape Sequence”. For the “Esc+”, type in “d”.
  4. For “Delete a word backword”, choose “Send Hex Code”, and type in “0x1B 0x08”.