Terminal shortcut keys

keyboardsnow leopardterminal

I've recently immigrated from Ubuntu to Mac OSX Snow Leopard. I use the terminal (iterm2) extensively, and I am a great fan of shortcut keys.

The standard shortcut keys (which work in any GUI textbox) are:

  • + Jumps to first character in line
  • + Jumps to last character in line
  • + Moves one word forward
  • + Moves one word backward

How can I impose these shortcuts in iterm (or terminal)?

Are there any standard key bindings for these operations in Mac I should know and use?

Best Answer

The standard shell shortcuts (M- = meta = option or esc, C- = control):

  • M-b and M-f correspond to ⌥← and ⌥→
  • C-a and C-e correspond to ⌘← and ⌘→

⌥← and ⌥→ are bound to M-b and M-f by default on Lion's Terminal. On 10.6 you'll have to add them manually:

enter image description here

I haven't found any way to reassign ⌘← and ⌘→ in Terminal.