Change how Home and End Keys behave in Mac OS X

…the right way, instead of the stupid default way. In short:

Workaround for general apps/text editor, including TextMate

Use this app:
Or make it your way:

  1. Create ~/Library/KeyBindings/DefaultKeyBinding.dict
  2. Inside


        /* home */
        "\\UF729" = "moveToBeginningOfLine:";
        "$\\UF729" = "moveToBeginningOfLineAndModifySelection:";
        /* end */
        "\\UF72B" = "moveToEndOfLine:";
        "$\\UF72B" = "moveToEndOfLineAndModifySelection:";
        /* page up/down */
        "\\UF72C" = "pageUp:";
        "\\UF72D" = "pageDown:";
  3. Restart your favorite apps

More info:


Use this add-on:


  1. Go to Terminal > Preferences > Settings > Keyboard
  2. Double click on Home key. Choose action: "send string to shell". Input: Escape, O, H so that you got 33OH in the textbox.
  3. Do the same for End key with 33OF

If it doesn’t help, try another key-binding:

Edit 1. Or playing with terminal types (x-term/vt220).