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