summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Terpstra2011-08-13 10:34:08 -0500
committerBrett Terpstra2011-08-13 10:34:08 -0500
commit8881f64d6a9dc105bea9a64d78a33fbb69666c80 (patch)
treefeefc0291dd6d2fb8e2906f4aa4f1bb24a67e4d6
downloadKeyBindings-8881f64d6a9dc105bea9a64d78a33fbb69666c80.tar.bz2
Initial Commit
-rw-r--r--DefaultKeyBinding.dict180
-rw-r--r--KeyBindings.md109
-rw-r--r--readme.md102
3 files changed, 391 insertions, 0 deletions
diff --git a/DefaultKeyBinding.dict b/DefaultKeyBinding.dict
new file mode 100644
index 0000000..7879968
--- /dev/null
+++ b/DefaultKeyBinding.dict
@@ -0,0 +1,180 @@
+{
+ // copy character before cursor
+ "~z" = (moveLeftAndModifySelection:, copy:, moveRight:);
+ // repeat character before cursor
+ "~r" = (moveLeftAndModifySelection:, copy:, moveRight:, paste:);
+ // transpose characters
+ "~t" = (transpose:);
+
+ // uppercase word
+ "~+" = (uppercaseWord:, moveRight:, moveRight:);
+ // lowercase word
+ "~-" = (lowercaseWord:, moveRight:, moveRight:);
+ // capitalize word
+ "~." = (capitalizeWord:, moveRight:, moveRight:);
+
+ // delete word before cursor
+ "^w" = "deleteWordBackward:";
+ // select word
+ "~w" = selectWord:;
+ // cut word (fold)
+ "~f" = (selectWord:, cut:);
+ // copy word (grab)
+ "~g" = (selectWord:, copy:);
+ // paste word (hit)
+ "~h" = (selectWord:, paste:);
+
+ // select entire line/paragraph
+ "~l" = (moveToBeginningOfParagraph:, moveToEndOfParagraphAndModifySelection:, moveRightAndModifySelection:);
+ // select from beginning of paragrah to last character
+ "~s" = (moveToBeginningOfParagraph:, moveToEndOfParagraphAndModifySelection:);
+ // delete line/paragraph
+ "~d" = (selectParagraph:, delete:, moveToBeginningOfParagraph:);
+ // copy paragraph
+ "~y" = (moveToBeginningOfParagraph:, moveToEndOfParagraphAndModifySelection:, copy:);
+ // 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:);
+
+ // move paragraph up a line, inserting blank space after
+ "~," = (moveToBeginningOfParagraph:, deleteBackward:, moveToEndOfParagraph:, insertNewline:, deleteToBeginningOfParagraph:, moveRight:);
+ // move paragraph to end of document
+ "~ " = (selectParagraph:, setMark:, deleteToMark:, moveToEndOfDocument:, yank:, swapWithMark:);
+ // blank line after current
+ "~o" = (moveToEndOfParagraph:, insertNewline:);
+ // blank line before current
+ "~O" = (moveToBeginningOfParagraph:, moveLeft:, insertNewline:);
+
+ // comment with "//"
+ "@~/" = (moveToBeginningOfParagraph:, insertText:,"// ");
+ // comment with "#"
+ "@~3" = (moveToBeginningOfParagraph:, insertText:,"# ");
+
+
+ // bold selection
+ "@~b" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "**", yank:, moveLeft:, insertText:, "**", moveLeft:, moveLeft:);
+ // italicize selection
+ "@~i" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "*", yank:, moveLeft:, insertText:, "*", moveLeft:);
+
+ "^@w" = {
+ // return and tab
+ "\U000A" = insertNewlineIgnoringFieldEditor:;
+ "\U0009" = (insertText:, "\t");
+
+ // Headlines
+ "1" = (moveToBeginningOfParagraph:, insertText:, "# ");
+ "2" = (moveToBeginningOfParagraph:, insertText:, "## ");
+ "3" = (moveToBeginningOfParagraph:, insertText:, "### ");
+ "4" = (moveToBeginningOfParagraph:, insertText:, "#### ");
+
+ // links
+ "l" = { // markdown link
+ // create a link for selected text, cursor between () "[selected text](|)"
+ "t" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "[", yank:, moveLeft:, insertText:, "]()", moveLeft:); // link text
+ // create a link for selected text, inserting clipboard as url "[|selected text](clipboard contents)"
+ "c" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "[", setMark:, yank:, moveLeft:, insertText:, "](", pasteAsPlainText:, insertText:, ")", swapWithMark:); // link with clipboard
+ };
+ // image
+ "i" = { // link as image
+ // same as ll, but with image syntax "![selected text](|)"
+ "t" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "![", yank:, moveLeft:, insertText:, "]()", moveLeft:); // image link for text
+ // same as lc, but with image syntax "![selected text](|)"
+ "c" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "![", setMark:, yank:, moveLeft:, insertText:, "](", pasteAsPlainText:, insertText:, ")", swapWithMark:); // image with clipboard
+ };
+ // references
+ ":" = {
+ // create a reference from selected text
+ "t" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "[", setMark:, yank:, moveLeft:, insertText:, "]: ", moveLeft:);
+ // create a reference from selected text, clipboard as url
+ "c" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "[", setMark:, yank:, moveLeft:, insertText:, "]: ", pasteAsPlainText:, swapWithMark:);
+ };
+ // insert reference link
+ "[" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "[", setMark:, yank:, moveLeft:, insertText:, "][]", moveLeft:);
+
+ // lists
+ "+" = (setMark:, moveToBeginningOfParagraph:, insertText:, " + ");
+ "-" = (setMark:, moveToBeginningOfParagraph:, insertText:, " - ");
+ "*" = (setMark:, moveToBeginningOfParagraph:, insertText:, " * ");
+
+ // HTML
+ "=" = (insertText:, "=\"\"", moveLeft:);
+ "e" = (insertText:, "&;", moveLeft:); // entity
+ "/" = (insertText:, "http://"); // http://
+ };
+
+ // new list item after current
+ "~L" = (moveToEndOfParagraph:, insertNewline:, insertText:, " * ");
+
+ "^@s" = { // surround commands
+ // wrap () with spaces
+ "(" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "( ", yank:, moveLeft:, insertText:, " )", moveLeft:);
+ // wrap () no spaces
+ ")" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "(", yank:, moveLeft:, insertText:, ")", moveLeft:);
+ // wrap [] with spaces
+ "[" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "[ ", yank:, moveLeft:, insertText:, " ]", moveLeft:);
+ // wrap [] no spaces
+ "]" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "[", yank:, moveLeft:, insertText:, "]", moveLeft:);
+ // wrap {} with spaces
+ "{" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "{ ", yank:, moveLeft:, insertText:, " }", moveLeft:);
+ // wrap {} no spaces
+ "}" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "{", yank:, moveLeft:, insertText:, "}", moveLeft:);
+ // wrap <> with spaces
+ "<" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "< ", yank:, moveLeft:, insertText:, " >", moveLeft:);
+ // wrap <> no spaces
+ ">" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "<", yank:, moveLeft:, insertText:, ">", moveLeft:);
+ // wrap single quotes
+ "'" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "'", yank:, moveLeft:, insertText:, "'", moveLeft:);
+ // wrap backticks
+ "`" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "`", yank:, moveLeft:, insertText:, "`", moveLeft:);
+ // wrap double quote
+ "\"" = (setMark:, swapWithMark:, moveRightAndModifySelection:, deleteToMark:, insertText:, "\"", yank:, moveLeft:, insertText:, "\"", moveLeft:);
+ };
+
+ // move line up
+ "^@k" = (selectParagraph:, setMark:, deleteToMark:, moveLeft:, moveToBeginningOfParagraph:, yank:, moveLeft:, selectToMark:, moveLeft:);
+ // move line down
+ "^@j" = (selectParagraph:, setMark:, deleteToMark:, moveToEndOfParagraph:, moveRight:, setMark:, yank:, moveLeft:, selectToMark:);
+ // indent line
+ "^@l" = (moveToBeginningOfParagraph:, insertText:, "\t");
+ // outdent line (all the way)
+ "^@h" = (moveToBeginningOfParagraph:, selectWord:, delete:);
+ // copy line and paste above
+ "^~k" = (selectParagraph:, copy:, moveLeft:, paste:, moveLeft:);
+ // copy line and paste below
+ "^~j" = (selectParagraph:, copy:, moveRight:, paste:, moveLeft:);
+ // modify selection up
+ "@~$\Uf700" = (selectParagraph:, moveParagraphBackwardAndModifySelection:);
+ // modify selection down
+ "@~$\Uf701" = (selectParagraph:, moveParagraphForwardAndModifySelection:);
+
+ // TextMate Command-Return (I wish this worked in some form, but it doesn't seem to)
+ // "@\U000A" = (moveToEndOfParagraph:, insertNewline:);
+ // "@$\U000A" = (moveToBeginningOfParagraph:, moveLeft:, insertNewline:);
+
+ // Forward delete to end of paragraph
+ "@\Uf728" = deleteToEndOfParagraph:;
+ // Page Up
+ "\Uf72c" = pageUp:;
+ // Page Down
+ "\Uf72d" = pageDown:;
+ // Scroll up
+ "~\Uf72c" = scrollPageUp:;
+ // Scroll Down
+ "~\Uf72d" = scrollPageDown:;
+
+ // bookmark
+ "~1" = setMark:;
+ // jump to bookmark
+ "~2" = (swapWithMark:,centerSelectionInVisibleArea:);
+} \ No newline at end of file
diff --git a/KeyBindings.md b/KeyBindings.md
new file mode 100644
index 0000000..142364e
--- /dev/null
+++ b/KeyBindings.md
@@ -0,0 +1,109 @@
+<style>
+table { margin-bottom:20px; }
+col:nth-child(3) { width:450px; }
+col:nth-child(1),col:nth-child(2) { width: 80px !important; }
+td:nth-child(1), td:nth-child(2) { font-weight:bold; padding:0 }
+</style>
+
+DefaultKeyBindings.dict file for Mac OS X, created by [Brett Terpstra][] and based heavily on work done by [Lri][lrikeys]. See Lri's [gists][lrigists] and [website][lriweb] for more coding madness.
+
+[lrikeys]: http://www.cs.helsinki.fi/u/lranta/keybindings/
+[lriweb]: http://www.cs.helsinki.fi/u/lranta/
+[lrigists]: https://gist.github.com/Lri
+[brett terpstra]: http://brettterpstra.com
+
+*Grouped items begin with the groups shortcut, followed by the Keys specified. Items separated by commas are sequential, not concurrent.*
+
+| Group | Keys | Function |
+| :-------: | :---------------------: | :------------------------------------------------------ |
+| | &#x2325;z | copy character before cursor |
+| | &#x2325;r | repeat character before cursor |
+| | &#x2325;t | transpose characters |
+| | &#x2325;+ | uppercase word |
+| | &#x2325;- | lowercase word |
+| | &#x2325;. | capitalize word |
+| | ^w | delete word before cursor |
+| | &#x2325;w | select word |
+| | &#x2325;f | cut word (fold) |
+| | &#x2325;g | copy word (grab) |
+| | &#x2325;h | paste word (hit) |
+| | &#x2325;l | select entire line/paragraph |
+| | &#x2325;s | select from beginning of paragrah to last character |
+| | &#x2325;d | delete line/paragraph |
+| | &#x2325;y | copy paragraph |
+| | &#x2325;x | cut paragraph |
+| | &#x2325;p | paste paragraph below |
+| | &#x2325;&#x21E7;P | paste paragraph above |
+| | ^&#x21E7;A | select to beginning of paragraph and copy |
+| | ^&#x21E7;E | select to end of paragraph and copy |
+| | &#x2325;q | cut to beginning of paragraph |
+| | &#x2325;k | cut to end of paragraph |
+| | &#x2325;, | move paragraph up a line, inserting blank space after |
+| | &#x2325;&#x2420; | move paragraph to end of document |
+| | &#x2325;o | blank line after current |
+| | &#x2325;&#x21E7;O | blank line before current |
+| | &#x2318;&#x2325;/ | comment with "//" |
+| | &#x2318;&#x2325;3 | comment with "#" |
+[ All purpose key combos ]
+
+
+| Group | Keys | Function |
+| :---: | :--: | :------- |
+| | &#x2318;&#x2325;b | bold selection |
+| | &#x2318;&#x2325;i | italicize selection |
+|^&#x2318;w | &#x23CE; | force Return |
+|^&#x2318;w | &#x21E5; | force Tab |
+|^&#x2318;w | 1-4 | # Headlines |
+|^&#x2318;w | l,t | link text `"[selected text]( | )"` |
+|^&#x2318;w | l,c | clipboard link `"[ | selected text](clipboard contents)"` |
+|^&#x2318;w | i,t | image, selection as alt `"![selected text]( | )"` |
+|^&#x2318;w | i,c | clipboard image `"![ | selected text](clipboard contents)"` |
+|^&#x2318;w | :,t | create a reference from selected text |
+|^&#x2318;w | :,c | create a reference from selected text, clipboard as url |
+|^&#x2318;w | [ | insert reference link |
+|^&#x2318;w | +\|-\|* | lists |
+|^&#x2318;w | =,&#x2325;&#x21E7;L | new list item after current |
+|^&#x2318;w | e | entity |
+|^&#x2318;w | =,/ | http:// |
+[ Markdown-specific shortcuts (^&#x2318;W) ]
+
+
+| Group | Keys | Function |
+| :---: | :--: | :------- |
+|^&#x2318;s | ( | wrap () with spaces |
+|^&#x2318;s | ) | wrap () no spaces |
+|^&#x2318;s | \[ | wrap [] with spaces |
+|^&#x2318;s | \] | wrap [] no spaces |
+|^&#x2318;s | { | wrap {} with spaces |
+|^&#x2318;s | } | wrap {} no spaces |
+|^&#x2318;s | < | wrap <> with spaces |
+|^&#x2318;s | > | wrap <> no spaces |
+|^&#x2318;s | ' | wrap single quotes |
+|^&#x2318;s | ` | wrap backticks |
+|^&#x2318;s | " | wrap double quote |
+[ Surround (^&#x2318;s) ]
+
+
+| Group | Keys | Function |
+| :---: | :--: | :------- |
+| | ^&#x2318;k | move line up |
+| | ^&#x2318;j | move line down |
+| | ^&#x2318;l | indent line |
+| | ^&#x2318;h | outdent line (all the way) |
+| | ^&#x2325;k | copy line and paste above |
+| | ^&#x2325;j | copy line and paste below |
+| | &#x2318;&#x2325;&#xA71B;| modify selection up |
+| | &#x2318;&#x2325;&#xA71C;| modify selection down |
+| | &#x2318;&#x2421; | Forward delete to end of paragraph |
+[ List/Paragraph motion ]
+
+
+| Group | Keys | Function |
+| :---: | :-----------: | :--------------- |
+| | PgUp | Page Up |
+| | PgDown | Page Down |
+| | &#x2325;PgUp | Scroll up |
+| | &#x2325;PgDown| Scroll Down |
+| | &#x2325;1 | bookmark |
+| | &#x2325;2 | jump to bookmark |
+[ Document navigation ] \ No newline at end of file
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..ee810f3
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,102 @@
+DefaultKeyBindings.dict file for Mac OS X, created by [Brett Terpstra][] and based heavily on work done by [Lri][lrikeys]. See Lri's [gists][lrigists] and [website][lriweb] for more coding madness.
+
+[lrikeys]: http://www.cs.helsinki.fi/u/lranta/keybindings/
+[lriweb]: http://www.cs.helsinki.fi/u/lranta/
+[lrigists]: https://gist.github.com/Lri
+[brett terpstra]: http://brettterpstra.com
+
+*Grouped items begin with the groups shortcut, followed by the Keys specified. Items separated by commas are sequential, not concurrent.*
+
+| Group | Keys | Function |
+| :-------: | :---------------------: | :------------------------------------------------------ |
+| | &#x2325;z | copy character before cursor |
+| | &#x2325;r | repeat character before cursor |
+| | &#x2325;t | transpose characters |
+| | &#x2325;+ | uppercase word |
+| | &#x2325;- | lowercase word |
+| | &#x2325;. | capitalize word |
+| | ^w | delete word before cursor |
+| | &#x2325;w | select word |
+| | &#x2325;f | cut word (fold) |
+| | &#x2325;g | copy word (grab) |
+| | &#x2325;h | paste word (hit) |
+| | &#x2325;l | select entire line/paragraph |
+| | &#x2325;s | select from beginning of paragrah to last character |
+| | &#x2325;d | delete line/paragraph |
+| | &#x2325;y | copy paragraph |
+| | &#x2325;x | cut paragraph |
+| | &#x2325;p | paste paragraph below |
+| | &#x2325;&#x21E7;P | paste paragraph above |
+| | ^&#x21E7;A | select to beginning of paragraph and copy |
+| | ^&#x21E7;E | select to end of paragraph and copy |
+| | &#x2325;q | cut to beginning of paragraph |
+| | &#x2325;k | cut to end of paragraph |
+| | &#x2325;, | move paragraph up a line, inserting blank space after |
+| | &#x2325;&#x2420; | move paragraph to end of document |
+| | &#x2325;o | blank line after current |
+| | &#x2325;&#x21E7;O | blank line before current |
+| | &#x2318;&#x2325;/ | comment with "//" |
+| | &#x2318;&#x2325;3 | comment with "#" |
+[ All purpose key combos ]
+
+
+| Group | Keys | Function |
+| :---: | :--: | :------- |
+| | &#x2318;&#x2325;b | bold selection |
+| | &#x2318;&#x2325;i | italicize selection |
+|^&#x2318;w | &#x23CE; | force Return |
+|^&#x2318;w | &#x21E5; | force Tab |
+|^&#x2318;w | 1-4 | # Headlines |
+|^&#x2318;w | l,t | link text `"[selected text]( | )"` |
+|^&#x2318;w | l,c | clipboard link `"[ | selected text](clipboard contents)"` |
+|^&#x2318;w | i,t | image, selection as alt `"![selected text]( | )"` |
+|^&#x2318;w | i,c | clipboard image `"![ | selected text](clipboard contents)"` |
+|^&#x2318;w | :,t | create a reference from selected text |
+|^&#x2318;w | :,c | create a reference from selected text, clipboard as url |
+|^&#x2318;w | [ | insert reference link |
+|^&#x2318;w | +\|-\|* | lists |
+|^&#x2318;w | =,&#x2325;&#x21E7;L | new list item after current |
+|^&#x2318;w | e | entity |
+|^&#x2318;w | =,/ | http:// |
+[ Markdown-specific shortcuts (^&#x2318;W) ]
+
+
+| Group | Keys | Function |
+| :---: | :--: | :------- |
+|^&#x2318;s | ( | wrap () with spaces |
+|^&#x2318;s | ) | wrap () no spaces |
+|^&#x2318;s | \[ | wrap [] with spaces |
+|^&#x2318;s | \] | wrap [] no spaces |
+|^&#x2318;s | { | wrap {} with spaces |
+|^&#x2318;s | } | wrap {} no spaces |
+|^&#x2318;s | < | wrap <> with spaces |
+|^&#x2318;s | > | wrap <> no spaces |
+|^&#x2318;s | ' | wrap single quotes |
+|^&#x2318;s | ` | wrap backticks |
+|^&#x2318;s | " | wrap double quote |
+[ Surround (^&#x2318;s) ]
+
+
+| Group | Keys | Function |
+| :---: | :--: | :------- |
+| | ^&#x2318;k | move line up |
+| | ^&#x2318;j | move line down |
+| | ^&#x2318;l | indent line |
+| | ^&#x2318;h | outdent line (all the way) |
+| | ^&#x2325;k | copy line and paste above |
+| | ^&#x2325;j | copy line and paste below |
+| | &#x2318;&#x2325;&#xA71B;| modify selection up |
+| | &#x2318;&#x2325;&#xA71C;| modify selection down |
+| | &#x2318;&#x2421; | Forward delete to end of paragraph |
+[ List/Paragraph motion ]
+
+
+| Group | Keys | Function |
+| :---: | :-----------: | :--------------- |
+| | PgUp | Page Up |
+| | PgDown | Page Down |
+| | &#x2325;PgUp | Scroll up |
+| | &#x2325;PgDown| Scroll Down |
+| | &#x2325;1 | bookmark |
+| | &#x2325;2 | jump to bookmark |
+[ Document navigation ] \ No newline at end of file