by

Tuning iTerm2 Shortcut Keys

Please meet iTerm, alternative replacement for native OSX terminal. This guy has been my preferred terminal since snow leopard. But the only thing that was missing is i want it to behave like a common text editor, where i can navigate through words using option+left (⌥ + ⇐), option+right (⌥ + ⇒), command+left (⌘ + ⇐), command+right (⌘ + ⇒).

Finally i found out that the iterm2 preferences and profile could be customized like this:
preferences

Set up key preferences

Navigate to the end of the line

  • Keyboard shortcut: ⌘ + ⇒
  • Send hex code
  • value: 0x05
Navigate to the beginning of line

  • Keyboard shortcut: ⌘ + ⇐
  • Send hex code
  • value: 0x01
Navigate to the end of word

  • Keyboard shortcut: ⌥ + ⇒
  • Send escape sequence
  • value: f
Navigate to the beginning of word

  • Keyboard shortcut: ⌥ + ⇐
  • Send escape sequence
  • value: b

setting up shortkey

Delete entire line from cursor position to the left

  • Keyboard shortcut: ⌘ + ␡ (command + delete)
  • Send hex code
  • value: 0x15
Delete one word from cursor position to the left

  • Keyboard shortcut: ⌥ + ␡ (option + delete)
  • Send hex code
  • value: 0x1b 0x08

Command delete key

Undo

  • Keyboard shortcut: ⌘ + Z
  • Send hex code
  • value: 0x1f
Redo

  • Keyboard shortcut: ⌘ + Y (redo)
  • Send hex code
  • value: 0x18 0x1f

Delete Key Mapping in Profiles

After creating new shortcut keys, usually there are duplicates in the profiles shortkeys.
Go to Profile » Manage Profiles » Edit Profiles. In the Keys tab, just delete the existing shortkeys that were duplicates with the new one.
delete the existing shortkey

For more key combination, please refer to: http://web.archive.org/web/20100501161453/http://www.classicteck.com/rbarticles/mackeyboard.php for references.

MacOS