Home and End Key on Mac

To change the behaviour of the "Home" and "End" key in Mac OS X, which is "move the cursor to the top/end of the document" you should follow this hint which makes the keys behave like on most other operating systems (move the cursor to the beginning/end of the current line).
The page up/down keys can be "fixed" too.
In short:
Save this to Users/username/Library/KeyBindings/DefaultKeyBinding.dict
{
"\UF729" = "moveToBeginningOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
"\UF72B" = "moveToEndOfLine:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
"\UF72C" = "pageUp:";
"\UF72D" = "pageDown:";
}