Skip to Content

Submit your nominations for the Luxist Awards' Best in Decor
AOL Tech

endofline posts

Filed under: Productivity, Terminal Tips

Remapping Key Combinations

Some people may think I am pro-*nix, but actually I really just like getting information out there for all our readers. Today I came across a great tip on Switch about Windows-like key bindings. If you don't dig the way Apple has the start and end key combos mapped in OS X, you can change them by creating the file ~/Library/KeyBindings/DefaultKeyBinding.dict with the following contents:

/* ~/Library/KeyBindings/DefaultKeyBinding.dict - Home/End keys more like Windows */
{
"\UF729" = "moveToBeginningOfLine:"; /* home */
"\UF72B" = "moveToEndOfLine:"; /* end */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* shift home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* shift end */
"^\UF729" = "moveToBeginningOfDocument:"; /* control home */
"^\UF72B" = "moveToEndOfDocument:";/* control end */
}


I personally tested this key binding hack in 10.4.4 and it does work. To test it be sure to quit out of your text application first. Also note that you will have to create a KeyBindings/ directory in your ~/Library/ because it is not there by default. To reverse the key bindings back to normal, just delete the DefaultKeyBinding.dict file you created and restart your text application. If there is a simpler GUI way to create these modifications please post about it in the comments for our readers.

If on the other hand you live in Terminal like me, the start of line and end of line key bindings are Control-A and Control-E respectively. This should feel comfortable to people accustomed to the normal Emacs mode in a shell in other *nix based operating systems.

[via Switch and comments on Ask Slashdot]

Tip of the Day

Reply in the Mail.app with a specific quote.
Select the text you want quoted and then hit the reply button.
Only your selected text will copied to the reply email.


Follow us on Twitter!
 TUAW [Cafepress]

Featured Galleries

DNC Macs
Macworld 2008 Keynote
Macworld 2008 Build-up
Google Earth for iPhone
Podcaster
Storyist 2.0
AT&T Navigator Road Test
Bento for iPhone 1.0
Scrabble for iPhone
Tom Bihn Checkpoint Flyer Briefcase
Apple Vanity Plates
Apple booth Macworld 07
WorldVoice Radio
Quickoffice for iPhone 1.1.1
Daylite 3.9 Review
DiscPainter
Mariner Calc for iPhone
2009CupertinoBus
Crash Bandicoot Nitro Kart 3D
MLB.com At Bat 2009
Macworld Expo 2007 show floor

 

More Apple Analysis

AOL Radio TUAW on Stitcher