~/Library/KeyBindings/DefaultKeyBinding.dict
A property list that enables you to bind keystrokes to sequences of Objective-C methods. It can be used to define text editing macros that work in most standard text views.
{
// copy paragraph (option-c)
"~c" = (selectParagraph:, copy:);
// convert selection to lowercase (option-minus)
"~-" = (lowercaseWord:, moveForward:);
// insert line below (command-return)
"@\r" = (moveToEndOfParagraph:, insertNewline:,
deleteToBeginningOfParagraph:);
// insert an XML tag (option-shift-x)
"~X" = (moveWordBackwardAndModifySelection:, setMark:, deleteToMark:,
insertText:, "<></>", moveBackward:, yank:, moveWordBackward:,
moveBackward:, moveBackward:, moveBackward:, yank:, moveForward:);
}
To get started, make ~/Library/KeyBindings/
and save a property list like the one above as DefaultKeyBinding.dict
.
More information: