Last active
December 13, 2022 12:36
-
-
Save ryecroft/7433433 to your computer and use it in GitHub Desktop.
DefaultKeyBinding.dict
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file is a bit of a mess to say the least, but it does have a load of examples in it. | |
// Most of it is cobbled together from various blogs. Applications need to be restarted for | |
// any changes to take effect. | |
// If you puts this stuff in '~/Library/KeyBindings/DefaultKeyBinding.dict', most proper mac | |
// applications will honour it (not Xcode though - that now has its own copy inside the app | |
// bundle, and uses a different format I think). | |
// The use most is at the end: | |
// move line up/down | |
// delete line | |
// duplicate line | |
// breakUndoCoalescing: | |
// capitalizeWord: | |
// center: | |
// centerSelectionInVisibleArea: | |
// checkSpelling: | |
// copy: | |
// cut: | |
// delete: | |
// deleteBackward: | |
// deleteForward: | |
// deleteToBeginningOfLine: | |
// deleteToBeginningOfParagraph: | |
// deleteToEndOfParagraph: | |
// deleteToMark: | |
// deleteWordBackward: | |
// hide: | |
// insertLineBreak: | |
// insertNewline: | |
// insertNewlineIgnoringFieldEditor: | |
// insertText: | |
// lowercaseWord: | |
// moveBackward: | |
// moveDown: | |
// moveForward: | |
// moveLeft: | |
// moveLeftAndModifySelection: | |
// moveParagraphBackwardAndModifySelection: | |
// moveParagraphForwardAndModifySelection: | |
// moveRight: | |
// moveRightAndModifySelection: | |
// moveToBeginningOfDocument: | |
// moveToBeginningOfLine: | |
// moveToBeginningOfParagraph: | |
// moveToBeginningOfParagraphAndModifySelection: | |
// moveToEndOfDocument: | |
// moveToEndOfLine: | |
// moveToEndOfParagraph: | |
// moveToEndOfParagraphAndModifySelection: | |
// moveUp: | |
// moveWordBackward: | |
// moveWordBackwardAndModifySelection: | |
// moveWordForward: | |
// moveWordForwardAndModifySelection: | |
// moveWordLeft: | |
// moveWordLeftAndModifySelection: | |
// moveWordRight: | |
// moveWordRightAndModifySelection: | |
// newDocument: | |
// openDocument: | |
// pageDown: | |
// pageUp: | |
// paste: | |
// pasteAsPlainText: | |
// performClose: | |
// performMiniaturize: | |
// performZoom: | |
// printDocument: | |
// redo: | |
// revertDocumentToSaved: | |
// rightMouseDown: | |
// saveAllDocuments: | |
// saveDocument: | |
// saveDocumentAs: | |
// scrollLineUp: | |
// scrollPageUp: | |
// selectAll: | |
// selectLine: | |
// selectParagraph: | |
// selectToMark: | |
// selectWord: | |
// setMark: | |
// swapWithMark: | |
// undo: | |
// uppercaseWord: | |
// yank: | |
// yankAndSelect: | |
{ // General | |
// > defaults write -g NSTextKillRingSize -string 6 | |
// replace yank: command with yankAndSelect for use with the kill ring | |
"^y" = (yankAndSelect:); | |
// uppercase word | |
"^U" = (uppercaseWord:, moveWordForward:, moveWordBackward:); | |
// lowercase word | |
"^~u" = (lowercaseWord:, moveWordForward:, moveWordBackward:); | |
// titlecase word | |
"^T" = (capitalizeWord:, moveWordForward:, moveWordBackward:); | |
// uppercase current paragraph | |
"^~U" = (setMark:, selectParagraph:, uppercaseWord:, swapWithMark:); | |
// lowercase current paragraph | |
// "^~u" = (setMark:, selectParagraph:, lowercaseWord:, swapWithMark:); | |
// titlecase paragraph | |
"^~t" = (setMark:, selectParagraph:, capitalizeWord:, swapWithMark:); | |
// delete word before cursor | |
//"^w" = (deleteWordBackward:); | |
// select word | |
"^w" = (selectWord:); | |
"^`" = (showGuessPanel:); | |
// select entire line/paragraph | |
"~S" = (moveToBeginningOfParagraph:, moveToEndOfParagraphAndModifySelection:, moveRightAndModifySelection:); | |
// select from beginning of paragrah to last character | |
"~s" = (moveToBeginningOfParagraph:, moveToEndOfParagraphAndModifySelection:); | |
// select paragraph excluding leading/trailing whitespace (same as ^$@\UF701) | |
"^~S" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, moveBackward:, moveToBeginningOfParagraphAndModifySelection:, moveWordForwardAndModifySelection:, moveWordBackwardAndModifySelection:); | |
// delete line/paragraph | |
"~d" = (selectParagraph:, delete:, moveToBeginningOfParagraph:); | |
// copy paragraph | |
"~y" = (setMark:, moveToBeginningOfParagraph:, moveToEndOfParagraphAndModifySelection:, copy:, swapWithMark:); | |
// cut paragraph | |
"~x" = (moveToBeginningOfParagraph:, moveToEndOfParagraphAndModifySelection:, cut:); | |
// paste paragraph below | |
"~p" = (moveToEndOfParagraph:,moveRight:,insertNewline:,moveLeft:, paste:); | |
// paste paragraph above | |
"~P" = (moveToBeginningOfParagraph:, moveLeft:, paste:); | |
// select to beginning of paragraph and copy | |
"^A" = (moveToBeginningOfParagraphAndModifySelection:, copy:); | |
// select to end of paragraph and copy | |
"^E" = (moveToEndOfParagraphAndModifySelection:, copy:); | |
// cut to beginning of paragraph | |
"~q" = (moveToBeginningOfParagraphAndModifySelection:, cut:); | |
// cut to end of paragraph | |
"~k" = (moveToEndOfParagraphAndModifySelection:, cut:); | |
// indent line | |
"@]" = (setMark:, moveToBeginningOfParagraph:, insertText:, " ", swapWithMark:, moveRight:); | |
// outdent line (one tab or char) | |
"@[" = (setMark:, moveToBeginningOfParagraph:, moveRight:, moveRight:, deleteBackward:, deleteBackward:, swapWithMark:); | |
// > same commands but with arrow keys | |
// move line up | |
//"^@\Uf700" = (selectParagraph:, setMark:, deleteToMark:, moveLeft:, moveToBeginningOfParagraph:, yank:, moveLeft:, selectToMark:, moveLeft:); | |
// move line down | |
//"^@\Uf701" = (selectParagraph:, setMark:, deleteToMark:, moveToEndOfParagraph:, moveRight:, setMark:, yank:, moveLeft:, selectToMark:); | |
// indent line | |
"^@\UF703" = (setMark:, moveToBeginningOfParagraph:, insertText:, " ", swapWithMark:, moveRight:); | |
// outdent line (one tab or char) | |
"^@\UF702" = (setMark:, moveToBeginningOfParagraph:, moveRight:, moveRight:, deleteBackward:, deleteBackward:, swapWithMark:); | |
// > Control-shift-command-left arrow | |
// Full outdent - Deletes all leading space of line/paragraph (updated) | |
"^$@\UF702" = (setMark:, moveToBeginningOfParagraph:, insertText:, " ", moveLeft:, selectWord:, delete:, swapWithMark:); | |
// Delete trailing space | |
"^$@\UF703" = (setMark:,moveToEndOfParagraph:, insertText:, " ", selectWord:, deleteBackward:, swapWithMark:); | |
// Delete leading and trailing whitespace for paragraph | |
"^@$\UF700" = (setMark:, moveToEndOfParagraph:, insertText:, " ", selectWord:, deleteBackward:, moveToBeginningOfParagraph:, insertText:, " ", moveLeft:, selectWord:, delete:, swapWithMark:); | |
// Select paragraph without leading or trailing whitespace (same as "^~s") | |
"^@$\UF701" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, moveBackward:, moveToBeginningOfParagraphAndModifySelection:, moveWordForwardAndModifySelection:, moveWordBackwardAndModifySelection:); | |
// modify selection up by paragraph (Command Option Shift Up) | |
"@~$\Uf700" = (selectParagraph:, moveParagraphBackwardAndModifySelection:); | |
// modify selection down by paragraph (Command Option Shift Down) | |
"@~$\Uf701" = (selectParagraph:, moveParagraphForwardAndModifySelection:); | |
// modify selection left by word | |
"^~$\UF702" = (selectWord:, moveWordLeftAndModifySelection:); | |
// modify selection right by word | |
"^~$\UF703" = (selectWord:, moveWordRightAndModifySelection:); | |
// Move to first Alphanumeric character of line (new) | |
"@~^\UF702" = (moveToBeginningOfParagraph:,moveWordRight:, moveWordLeft:); | |
// Move to first non-whitespace character of line (new) | |
"@~\UF702" = (moveToBeginningOfParagraph:, insertText:, " ", moveLeft:, selectWord:, moveRight:, setMark:, moveToBeginningOfParagraph:, deleteForward:, swapWithMark:, moveLeft:); | |
// Select to first character of line with leading space (new) | |
"@~$\UF702" = (setMark:,moveToBeginningOfParagraph:,selectWord:, moveRight:, selectToMark:); | |
// Move to last non-whitespace character of paragraph (new) | |
"~@\UF703" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, moveLeft:, setMark:, moveToEndOfParagraph:, deleteBackward:, swapWithMark:); | |
// Move to end of paragraph and delete trailing whitespace (new) | |
"^~\UF703" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, deleteBackward:); | |
// TextMate Command-Return (Command Enter) | |
"@\U000D" = (moveToEndOfParagraph:, insertNewline:); | |
// Insert blank line above paragraph (Command Shift Enter) | |
"@$\U000D" = (moveToBeginningOfParagraph:, moveLeft:, insertNewline:); | |
// > this will kill non alphanumeric symbols and punctuation, use only on *words* | |
// hyphenate next space and move to next word | |
"~_" = (selectWord:,moveRight:,setMark:,moveWordRight:,moveWordLeft:,moveLeft:,selectWord:,insertText:,"-",moveWordRight:); | |
// bookmark | |
"~1" = (setMark:); | |
// jump to bookmark | |
"~2" = (swapWithMark:,centerSelectionInVisibleArea:); | |
// > Command Option Enter | |
// Continue a list item with indentation and include the same delimiter | |
"~@\U000D" = ( breakUndoCoalescing, moveToEndOfParagraph:, insertText:, "x", moveToBeginningOfParagraph:, selectWord:, moveRightAndModifySelection:, moveWordForwardAndModifySelection:, moveWordBackwardAndModifySelection:, moveLeftAndModifySelection:, setMark:, deleteToMark:, yank:, moveToEndOfParagraph:, deleteBackward:, insertNewlineIgnoringFieldEditor:, deleteToBeginningOfParagraph:, yank:, insertText:, " ", selectWord:, insertText:, " "); | |
// > Shift Tab | |
// remove one tab (or character) from start of line (outdent) | |
"$\U0009" = (setMark:, moveToBeginningOfParagraph:, moveRight:, deleteBackward:, swapWithMark:, moveLeft:); | |
"^@c" = { // Commenting commands | |
// comment with "//" | |
"/" = (moveToBeginningOfParagraph:, insertText:, "// ", moveToEndOfParagraph:, moveForward:); | |
// comment with "#" | |
"\\" = (moveToBeginningOfParagraph:, insertText:, "# ", moveToEndOfParagraph:, moveForward:); | |
// HTML commenting | |
"!" = (setMark:, swapWithMark:, delete:, insertText:, "<!-- ", yank:, insertText:, " -->", swapWithMark:, moveRight:, moveRight:, moveRight:, moveRight:, moveRight:); | |
// Css Commenting | |
"*" = (setMark:, swapWithMark:, delete:, insertText:, "/* ", yank:, insertText:, " */", swapWithMark:, moveRight:, moveRight:, moveRight:); | |
}; | |
// bold selection (Markdown) | |
"@~b" = (selectWord:, setMark:, swapWithMark:, deleteToMark:, insertText:, "**", yank:, insertText:, " ", moveLeft:, insertText:, "**", moveRight:, deleteBackward:); | |
// italicize selection (Markdown) | |
"@~i" = (selectWord:, setMark:, swapWithMark:, deleteToMark:, insertText:, "*", yank:, insertText:, " ", moveLeft:, insertText:, "*", moveRight:, deleteBackward:); | |
// increase markdown header level | |
"@~=" = (setMark:, moveToBeginningOfParagraph:, insertText:, "# ", selectWord:, delete:, swapWithMark:, moveRight:); | |
// decrease markdown header level | |
"@~-" = (setMark:, moveToBeginningOfParagraph:, deleteForward:, swapWithMark:, moveLeft:); | |
// Add hard break for current line and insert newline below (new) | |
"^~\U000D" = (moveToEndOfParagraph:, insertText:, " ", selectWord:, deleteBackward:, insertText:, " ", insertNewline:); | |
// Break line at cursor and add Markdown hard line break (new) | |
"^@\U000D" = (insertText:, " ", insertNewline:); | |
"^@w" = { // Multi-stroke Markdown commands | |
// force carriage return in text field | |
"\U000A" = (insertNewlineIgnoringFieldEditor:); | |
// force tab in text field | |
"\U0009" = (insertText:, "\t"); | |
// insert reference link `[selection][[cursor]]` | |
"[" = (setMark:, swapWithMark:, deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, insertText:, " ", moveLeft:, insertText:, "][]", moveRight:, deleteBackward:, moveLeft:); | |
// insert reference `[selection]: [cursor]` | |
"]" = (setMark:, swapWithMark:, deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, insertText:, " ", moveLeft:, insertText:, "]: ", moveRight:, deleteBackward:, deleteForward:); | |
// Unordered list item with | |
"+" = (setMark:, moveToBeginningOfParagraph:, insertText:, "+ ", swapWithMark:, moveRight:, moveRight:); | |
// Unordered list item with - | |
"-" = (setMark:, moveToBeginningOfParagraph:, insertText:, "- ", swapWithMark:, moveRight:, moveRight:); | |
// Unordered list item with * | |
"*" = (setMark:, moveToBeginningOfParagraph:, insertText:, "* ", swapWithMark:, moveRight:, moveRight:); | |
// convert current numbered list item to bullet, handles indentation | |
"8" = (breakUndoCoalescing, setMark:, moveToEndOfParagraph:, insertText:, "x", moveToBeginningOfParagraph:, moveWordForward:, moveRight:, moveWordForward:, moveWordBackward:, moveWordBackwardAndModifySelection:, insertText:, "* ", moveToEndOfParagraph:, deleteBackward:, swapWithMark:, moveLeft:); | |
// convert current bullet list item to numbered | |
"1" = (breakUndoCoalescing, setMark:, moveToEndOfParagraph:, insertText:, "x", moveToBeginningOfParagraph:, moveWordForward:, moveWordBackward:, moveLeftAndModifySelection:, moveLeftAndModifySelection:, insertText:, "1. ", moveToEndOfParagraph:, deleteBackward:, swapWithMark:, moveRight:); | |
"h" = { // Headlines (removes leading whitespace after inserting hashmarks) | |
// # | |
"1" = (setMark:, moveToBeginningOfParagraph:, insertText:, "# ", selectWord:, insertText:, " ",swapWithMark:, moveToEndOfParagraph:); | |
// ## | |
"2" = (setMark:, moveToBeginningOfParagraph:, insertText:, "## ", selectWord:, insertText:, " ", swapWithMark:, moveToEndOfParagraph:); | |
// ### | |
"3" = (setMark:, moveToBeginningOfParagraph:, insertText:, "### ", selectWord:, insertText:, " ", swapWithMark:, moveToEndOfParagraph:); | |
// #### | |
"4" = (setMark:, moveToBeginningOfParagraph:, insertText:, "#### ", selectWord:, insertText:, " ", swapWithMark:, moveToEndOfParagraph:); | |
// ##### | |
"5" = (setMark:, moveToBeginningOfParagraph:, insertText:, "##### ", selectWord:, insertText:, " ", swapWithMark:, moveToEndOfParagraph:); | |
// ###### | |
"6" = (setMark:, moveToBeginningOfParagraph:, insertText:, "###### ", selectWord:, insertText:, " ", swapWithMark:, moveToEndOfParagraph:); | |
}; | |
// > links | |
// > without selected text first, these can produce a mess using multiple clipboards | |
// > make a text selection before you run them | |
"l" = { // Markdown link | |
// create a link for selected text, cursor between () `[selected text]([cursor])` | |
"t" = (setMark:, breakUndoCoalescing:, moveRight:, insertText:, " ", deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, moveLeft:, insertText:, "]()", moveRight:, deleteBackward:, moveLeft:, setMark:, insertText:, "http://", selectToMark:); // link text | |
// create a link for selected text, inserting clipboard as url `[[cursor]selected text](clipboard contents)` | |
"c" = (setMark:, breakUndoCoalescing:, moveRight:, insertText:, " ", deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, moveLeft:, insertText:, "](", setMark:, pasteAsPlainText:, insertText:, ")", moveRight:, deleteBackward:, moveLeft:, selectToMark:); // link with clipboard | |
}; | |
"i" = { // Link as image | |
// TODO: Apply the fix from l,t/c above to avoid inserting the kill buffer when there's no selection | |
// same as lt, but with image syntax `` | |
"t" = (setMark:, swapWithMark:, deleteToMark:, insertText:, "![", yank:, insertText:, " ", moveLeft:, insertText:, "]()", moveRight:, deleteBackward:, moveLeft:); // image link for text | |
// same as lc, but with image syntax `` | |
"c" = (setMark:, swapWithMark:, deleteToMark:, insertText:, "", moveRight:, deleteBackward:, swapWithMark:); | |
}; | |
":" = { // Reference links | |
// create a reference from selected text | |
"t" = (setMark:, swapWithMark:, deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, insertText:, " ", moveLeft:, insertText:, "]: ", moveRight:, deleteBackward:); | |
// create a reference from selected text, clipboard as url | |
"c" = (setMark:, swapWithMark:, deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, insertText:, " ", moveLeft:, insertText:, "]: ", pasteAsPlainText:, moveRight:, deleteBackward:, swapWithMark:); | |
}; | |
}; | |
"^@e" = { // HTML commands | |
// ="[cursor]" | |
"=" = (insertText:, "=\"\"", moveLeft:); | |
// entity &[cursor]; | |
"e" = (insertText:, "&;", moveLeft:); | |
// http:// | |
"/" = (insertText:, "http://"); | |
// Make previous word into paired HTML tag | |
"t" = ( "setMark:", "moveWordBackward:", "deleteToMark:", "insertText:", "<", "yank:", "insertText:", ">", "setMark:", "insertText:", "</", "yank:", "insertText:", ">", "swapWithMark:"); | |
"a" = { // HTML Links | |
// Insert HTML link for selected text, leave cursor in the href with "http://" selected | |
"t" = ( setMark:, swapWithMark:, deleteToMark:, insertText:, "<a href=\"", setMark:, insertText:, "\">", yank:, insertText:, "</a>", swapWithMark:, setMark:, insertText:, "http://", selectToMark: ); | |
// Insert HTML link with clipboard as href | |
"c" = ( setMark:, swapWithMark:, deleteToMark:, insertText:, "<a href=\"", paste:, insertText:, "\">", yank:, insertText:, "</a>" ); | |
}; | |
"i" = { // HTML Image | |
// Insert image tag, any selected text is alt text, leave cursor in src attribute | |
"t" = ( setMark:, swapWithMark:, deleteToMark:, insertText:, "<img src=\"", setMark:, insertText:, "\" alt=\"", yank:, insertText:, "\">", swapWithMark: ); | |
// Insert image tag, clipboard as src, any selected text as alt, leave cursor at beginning of alt attribute | |
"c" = ( setMark:, swapWithMark:, deleteToMark:, insertText:, "<img src=\"", paste:, insertText:, "\" alt=\"", setMark:, yank:, insertText:, "\">", swapWithMark: ); | |
}; | |
}; | |
// Make selected text into paired HTML tag. Allows attributes, only dupes first word into closing tag (caveat: overwrites your pasteboard) | |
"^<" = ( setMark:, deleteToMark:, insertText:, "<", setMark:, yank:, swapWithMark:, moveWordForwardAndModifySelection:, copy:, swapWithMark:, "insertText:", ">", "setMark:", "insertText:", "</", "paste:", "insertText:", ">", "swapWithMark:"); | |
"^s" = { // Surround commands | |
// wrap () with spaces | |
"(" = (delete:, insertText:, "(", yank:, insertText:, ")"); | |
// wrap () no spaces | |
")" = (delete:, insertText:, "(", yank:, insertText:, ")"); | |
// wrap [] with spaces | |
"[" = (delete:, insertText:, "[", yank:, insertText:, "]"); | |
// wrap [] no spaces | |
"]" = (delete:, insertText:, "[", yank:, insertText:, "]"); | |
// wrap {} with spaces | |
"{" = (delete:, insertText:, "{", yank:, insertText:, "}"); | |
// wrap {} no spaces | |
"}" = (delete:, insertText:, "{", yank:, insertText:, "}"); | |
// wrap <> with spaces | |
"<" = (delete:, insertText:, "<", yank:, insertText:, ">"); | |
// wrap <> no spaces | |
">" = (delete:, insertText:, "<", yank:, insertText:, ">"); | |
// wrap single quotes | |
"'" = (delete:, insertText:, "'", yank:, insertText:, "'"); | |
// wrap backticks | |
"`" = (delete:, insertText:, "`", yank:, insertText:, "`"); | |
// wrap double quote | |
"\"" = (delete:, insertText:, " \"", deleteBackward:, yank:, insertText:, "\""); | |
}; | |
// "$\U002B" = { // Vim Example commands (A little vim, just as an example) | |
// // paste after | |
// "p" = (moveToEndOfParagraph:,moveRight:,insertNewline:,moveLeft:, yank:); | |
// // paste before | |
// "P" = (moveToBeginningOfParagraph:, moveLeft:, yank:); | |
// // yank | |
// "y" = (yank:); | |
// | |
// "d" = { // Delete | |
// // 'dd' delete line/paragraph | |
// "d" = (setMark:, selectParagraph:, delete:, delete:, swapWithMark:); | |
// // 'd$' delete from cursor to end of graf | |
// "$" = (moveToEndOfParagraphAndModifySelection:, delete:); | |
// // 'd0' delete to beginning of paragraph | |
// "0" = (moveToBeginningOfParagraphAndModifySelection:, delete:); | |
// // 'd^' delete to beginning of paragraph | |
// "^" = (moveToBeginningOfParagraphAndModifySelection:, delete:); | |
// }; | |
// | |
// "5" = { // Repeat 5 times | |
// "d" = { // Delete | |
// // 'dd' delete line/paragraph | |
// "d" = ( selectParagraph:, delete:, delete:, moveRight:, selectParagraph:, delete:, delete:, moveRight:, selectParagraph:, delete:, delete:, moveRight:, selectParagraph:, delete:, delete:, moveRight:, selectParagraph:, delete:, delete:, moveRight:); | |
// }; | |
// // paste after | |
// "p" = ( moveToEndOfParagraph:, moveRight:, insertNewline:, moveLeft:, yank:, moveToEndOfParagraph:, moveRight:, insertNewline:, moveLeft:, yank:, moveToEndOfParagraph:, moveRight:, insertNewline:, moveLeft:, yank:, moveToEndOfParagraph:, moveRight:, insertNewline:, moveLeft:, yank:, moveToEndOfParagraph:, moveRight:, insertNewline:, moveLeft:, yank:); | |
// // paste before | |
// "P" = ( moveToBeginningOfParagraph:, moveLeft:, yank:, moveToBeginningOfParagraph:, moveLeft:, yank:, moveToBeginningOfParagraph:, moveLeft:, yank:, moveToBeginningOfParagraph:, moveLeft:, yank:, moveToBeginningOfParagraph:, moveLeft:, yank:); | |
// // yank | |
// "y" = ( yank:, yank:, yank:, yank:, yank:); | |
// }; | |
// }; | |
"\UF729" = "moveToBeginningOfLine:"; /* home key */ | |
"\UF72B" = "moveToEndOfLine:"; /* end key */ | |
// repeat character before cursor | |
// "~r" = (moveLeftAndModifySelection:, copy:, moveRight:, paste:); | |
// Forward delete to end of paragraph | |
// "@$\Uf728" = (deleteToEndOfParagraph:); | |
// Delete to beginning of paragraph | |
// "@$\177" = (deleteToBeginningOfParagraph:); | |
// Right mouse click (useless, doesn't maintain cursor position) | |
"@~7" = (setMark:, rightMouseDown:, swapWithMark:); | |
// "^\UF702" = "moveSubwordLeft:"; // control-left | |
// "^\UF703" = "moveSubwordRight:"; // control-right | |
//textmate-style duplicate line | |
"^$D" = ("moveToEndOfLine:", | |
"deleteToBeginningOfLine:", // line in kill buffer | |
"yank:", // put back what was deleted | |
"insertLineBreak:", | |
"moveToBeginningOfLine:", | |
"yank:"); // duplicate line | |
// <key>Add Newline Before This</key> | |
// <string>moveToLeftEndOfLine:, insertNewline:, moveUp:, insertTab:</string> | |
"^$K" = ("moveToEndOfLine:", "deleteToBeginningOfLine:", "moveForward:", "deleteBackward:", "moveToEndOfLine:"); | |
// Move line up | |
"^@\UF700" = ("moveToEndOfLine:", "moveToBeginningOfLineAndModifySelection:", "delete:", "deleteBackward:", "moveToBeginningOfLine:", "yank:", "insertNewline:", "moveBackward:"); | |
// Move line down | |
"^@\UF701" = ("moveToEndOfLine:", "moveToBeginningOfLineAndModifySelection:", "delete:", "deleteForward:", "moveToEndOfLine:", "insertNewline:", "yank:"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment