Editing the default keybindings file, 

{{{
~/Library/KeyBindings/DefaultKeyBinding.dict
}}}

Create the directory and / or the file if they're not already there, and make it look like this:

{{{
{
/* Remap Home / End to be correct :-) */
"\UF729"  = "moveToBeginningOfLine:";                   /* Home         */
"\UF72B"  = "moveToEndOfLine:";                         /* End          */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";       /* Shift + End  */
}
}}}

If there are already entries in DefaultKeyBinding.dict, just add the 4 new mappings above to the main section of your file.

----
[CategoryFixme] : [CategoryComputing.Mac]