Download the new Switched app for your iPhone

Skip to Content

Stay up to date with Switched's CES 2010 coverage
AOL Tech

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]
jobs & resumes
iPhone / Android Developer

Bump Technologies, Inc. - Mountain View, CA (2 weeks ago)

See More Relevant Jobs ›

Reader Comments (Page 1 of 1)

Tip of the Day

Want to drag a file to another folder and copy it instead of moving it? Press the Option key when you drag that file and it'll be duplicated rather than moved entirely.

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

 

Our Writers

Victor Agreda, Jr.

Programming Manager, AOL Tech

RSS Feed

View more Writers

More Apple Analysis

AOL Radio TUAW on Stitcher