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: http://www.starryhope.com/tech/apple/2006/keyfixer/
Or make it your way:

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

    write

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

More info: http://www.starryhope.com/tech/2006/mac-os-x-home-and-end-keys/

Firefox

Use this add-on: https://addons.mozilla.org/en-US/firefox/addon/keyfixer/

Terminal

  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: http://fplanque.com/dev/mac/mac-osx-terminal-page-up-down-home-end-of-line

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

One response to “Change how Home and End Keys behave in Mac OS X

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s