Saturday, June 1, 2013

Get HOME / END keys working on MacOSX

There is a possibility that the Home/End keys on the keyboard don't work as expected in your MacOSX. So, while editing the text, to make it work the way it is supposed to, create a file as described below

~/Library/KeyBindings/DefaultKeyBinding.dict

Contents of the file:

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