random technical thoughts from the Nominet technical team

Changing behaviour of home, end, page up and page down in OSX

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Posted by jay on Feb 13th, 2007

I find the default OSX key behaviour for home, end, page up and page down a bit irritating. The default is for home and end to go respectively to the beginning and end of the document, whilst page up and page down move the screen without moving the caret. My strong preference is for the home and end to go to the beginning and end of the line and for page up and page down to move the caret as well as the document. These behaviours are actually the Windows standard.

I could probably get used to the OSX way but there are so many applications I use that do it the Windows way that I’m forever getting confused between the two methods. So all round it is easier to just switch apps that follow the OSX guidelines to do it the other way. Be warned though that some apps might still have their own way of doing this.

There is a great article on this at the TextMate Blog with lots of detail, but here is the same info in one easy step (well almost):

Create a new directory and file called ~/Library/KeyBindings/DefaultKeyBinding.dict with the following content:

{

    /* home */

    "\UF729"  = "moveToBeginningOfLine:";

    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";    /* end */

    "\UF72B"  = "moveToEndOfLine:";

    "$\UF72B" = "moveToEndOfLineAndModifySelection:";

/* page up/down */

    "\UF72C"  = "pageUp:";

    "\UF72D"  = "pageDown:";

}

And then restart your OSX application and it will pick these up.

One Response

  1. Chris Says:

    I think those U’s should be preceded by a slash in each case. That’s what the original article has.

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Recent Posts

Highest Rated

Categories

Archives

Meta: