Can home and end keys be mapped when using Terminal? The Home and End keys on a MacBook Pro can be emulated with Fn + ← or fFn + →.  Or when certain settings are changed, with the ⌘ Command key instead of Fn.
None of these works in Terminal.
As I frequently need to go to the beginning or end of the line and would also like to jump forwards or backwards by word.
How can I jump around on a line in Terminal?
To answer the one about how to get the beginning or end of the line, it appears that by default Terminal maps these keys to it:


shift+home &rarr; beginning of line, equivalent to the "home" key in normal terminals
shift+end &rarr; end of line, equivalent to the "end" key in normal terminals


If you want home and end to work the "normal" way (and not require shift), go to [Terminal menu] &rarr; Preferences &rarr; Profiles tab (or settings on some versions of OS X) &rarr; Keyboard sub-tab.

Then modify/add these keys to be the following "send string to shell"


home: \033[H
end:  \033[F


You can get the \033 part by hitting the escape key within the edit dialog input, if you need to add it.

Then home and end will work like normal again (phew).

Also note that "alt + &larr;" and "alt + &rarr;" by default in terminal map to word left and word right, another handy combo to remember.

In later versions of Mac OS X, if the terminal screen shifts up or down when you press the home/end key, the home key may need to be set to \033[1~ and the end key to \033[4~ to get the results you want (no shift needed).

Feel free to modify this answer to add more useful key bindings, as it is a community wiki.