Key bindings are those combinations of keys that allow you to make simple and complex functions/actions available in a single command. For example to go to the beginning of a line you could just press Control-A, to captilize a word Control-u, to delete a world Option-d. These are set in two files, one of which is the default (but we’re not going to worry about that file), and another which is: /Users/YOU/Library/KeyBindings/DefaultKeyBinding.dict. If you want to set your own you first need to create that file, then you set the Key Bindings in the following format:
"Key Modifier" = "Action:";
Here are the available Key Modifiers:
^ : Ctrl
$ : Shift
~ : Option (Alt)
@ : Command (Apple)
# : Numeric Keypad
And here are the available Actions:
alignCenter: newDocument:
alignJustified: openDocument:
alignLeft: orderBack:
alignRight: orderFront:
breakUndoCoalescing orderFrontLinkPanel:
cancelOperation: orderFrontListPanel:
capitalizeWord: orderFrontSpacingPanel:
center orderFrontTablePanel:
centerSelectionInVisibleArea: outline:
changeCaseOfLetter: pageDown:
checkSpelling: pageUp:
clearRecentDocuments: paste:
complete: pasteAsPlainText:
copy: pasteAsRichText:
copyFont: pasteFont:
copyRuler: pasteRuler:
cut: performClose:
delete: performMiniaturize:
deleteBackward: performZoom:
deleteBackwardByDecomposingPreviousCharacter: printDocument:
deleteForward: raiseBaseline:
deleteToBeginningOfLine: revertDocumentToSaved:
deleteToBeginningOfParagraph: runPageLayout:
deleteToEndOfLine: saveAllDocuments:
deleteToEndOfParagraph: saveDocument:
deleteToMark: saveDocumentAs:
deleteWordBackward: saveDocumentTo:
deleteWordForward: scrollLineDown:
hide: scrollLineUp:
ignoreSpelling: scrollPageDown:
indent: scrollPageUp:
insertBacktab: selectAll:
insertContainerBreak: selectLine:
insertLineBreak: selectParagraph:
insertNewline: selectToMark:
insertNewlineIgnoringFieldEditor: selectWord:
insertParagraphSeparator: setMark:
insertTab: showContextHelp:
insertTabIgnoringFieldEditor: showGuessPanel:
insertText: startSpeaking:
loosenKerning: stopSpeaking:
lowerBaseline: subscript:
lowercaseWord: superscript:
moveBackward: swapWithMark:
moveBackwardAndModifySelection: terminate:
moveDown: tightenKerning:
moveDownAndModifySelection: toggleBaseWritingDirection:
moveForward: toggleContinuousSpellChecking:
moveForwardAndModifySelection: toggleRuler:
moveLeft: transpose:
moveLeftAndModifySelection: transposeWords:
moveRight: turnOffKerning:
moveRightAndModifySelection: turnOffLigatures:
moveToBeginningOfDocument: underline:
moveToBeginningOfDocumentAndModifySelection: unscript:
moveToBeginningOfLine: uppercaseWord:
moveToBeginningOfLineAndModifySelection: useAllLigatures:
moveToBeginningOfParagraph: useStandardKerning:
moveToEndOfDocument: useStandardLigatures:
moveToEndOfDocumentAndModifySelection: yank:
moveToEndOfLineAndModifySelection:
moveToEndOfLine:
moveToEndOfParagraph:
moveUp:
moveUpAndModifySelection:
moveWordBackward:
moveWordBackwardAndModifySelection:
moveWordForward:
moveWordForwardAndModifySelection:
moveWordLeft:
moveWordLeftAndModifySelection:
moveWordRight:
moveWordRightAndModifySelection:
[Via: http://www.lsmason.com/articles/macosxkeybindings.html]
For example to create that command to capitlize a word the file would be:
{ "~c" = "capitalizeWord:"; } [I added in the squiggly brackets because all the commands need to be in squiggly brackets (thats 1 set of brackets for the entire file not each Key Binding)]
However you really don’t need to worry about creating your own as some of sites already have good examples that you can just copy and paste.
This one is probably the best:
{
"~f" = "moveWordForward:"; /* M-f */
"~b" = "moveWordBackward:"; /* M-b */
"~" = "moveToEndOfDocument:"; /* M-> */
"~v" = "pageUp:"; /* M-v */
"^v" = "pageDown:"; /* C-v */
"~d" = "deleteWordForward:"; /* M-d */
"~^h" = "deleteWordBackward:"; /* M-C-h */
"~10" = "deleteWordBackward:"; /* M-backspace */
"~\177" = "deleteWordBackward:"; /* M-delete */
"~\UF728" = "deleteWordForward:"; /* delete */
"\UF729" = "moveToBeginningOfDocument:"; /* home */
"\UF72B" = "moveToEndOfDocument:"; /* end */
"@\UF729" = "moveToBeginningOfParagraph:"; /* A-home */
"@\UF72B" = "moveToEndOfParagraph:"; /* A-end */
"@\UF700" = "moveToBeginningOfDocument:"; /* A-up */
"@\UF701" = "moveToEndOfDocument:"; /* A-down */
"^\UF700" = "pageUp:"; /* C-up */
"^\UF701" = "pageDown:"; /* C-down */
"\UF72C" = "pageUp:"; /* page-up */
"\UF72D" = "pageDown:"; /* page-down */
"^/" = "undo:"; /* C-/ */
"~c" = "capitalizeWord:"; /* M-c */
"~u" = "uppercaseWord:"; /* M-u */
"~l" = "lowercaseWord:"; /* M-l */
"^t" = "transpose:"; /* C-t */
"~t" = "transposeWords:"; /* M-t */
"~/" = "complete:"; /* M-/ */
"^g" = "_cancelKey:"; /* C-g */
"^a" = "moveToBeginningOfLine:"; /* C-a */
"^e" = "moveToEndOfLine:"; /* C-e */
"^x" = {
"^x" = "swapWithMark:"; /* C-x C-x */
"^m" = "selectToMark:"; /* C-x C-m */
"^s" = "save:"; /* C-x C-s */
"^w" = "saveAs:"; /* C-x C-w */
"k" = "performClose:"; /* C-x C-k */
};
/* Mark-point stuff (Emacs-style mark and point bindings are
* implemented but not bound by default. In the text system the
* mark and point are ranges, not just locations. The "point" is
* the selected range.)
*/
"^@" = "setMark:"; /* C-@ */
"^ " = "setMark:"; /* C-space */
"^w" = "deleteToMark:"; /* C-w */
/* Mac Style F1-F5 bindings */
"\UF704" = "undo:"; /* F1 */
"\UF705" = "cut:"; /* F2 */
"\UF706" = "copy:"; /* F3 */
"\UF707" = "paste:"; /* F4 */
"\UF708" = "_cancelKey:"; /* F5 */
}
[Via: http://www.lsmason.com/articles/macosxkeybindings.html], however there are other examples on the same site, plus
- http://hcs.harvard.edu/~jrus/Site/cocoa-text.html
- http://macromates.com/blog/archives/2005/07/05/key-bindings-for-switchers/
- http://developer.apple.com/documentation/Cocoa/Conceptual/EventOverview/index.html
- http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSResponder_Class/index.html
- http://www.macosxhints.com/article.php?story=20070215034801484
- http://www.macosxhints.com/article.php?story=20060317045211408
- http://www.danrodney.com/mac/index.html
All of these commands are available only to Cocoa applications.

Trackback
[...] Los key bindings son combinaciones de teclas que te permiten realizar operaciones simples o complejas en un solo comando, lo que vienen a ser atajos de teclado con algunas posibilidades más. Puedes configurar atajos para borrar palabras enteras, seleccionar párrafos, convertirlos a mayúsculas, etc. En MacTips nos enseñan cuantas opciones hay y cómo configurarlas. [...]
February 19th, 2008 at 3:14 am