diff options
| author | Brett Terpstra | 2011-12-06 09:11:15 -0600 |
|---|---|---|
| committer | Brett Terpstra | 2011-12-06 09:11:15 -0600 |
| commit | 7dcf67d8a330286500920bb7bfe44afe755b2030 (patch) | |
| tree | 86c2b950ddc17e24f0d9110997a76d5dee8a3898 | |
| parent | b341397f0e4fa9f164fe4a9105b7985b461ab6f0 (diff) | |
| download | KeyBindings-7dcf67d8a330286500920bb7bfe44afe755b2030.tar.bz2 | |
Figured out how to avoid inserting previous kill buffer text when there's no selection on link commands. ctrl-cmd-w,l,t/c are fixed, will apply to the others soon.
| -rw-r--r-- | DefaultKeyBinding.dict | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/DefaultKeyBinding.dict b/DefaultKeyBinding.dict index c58d0b5..cc24a27 100644 --- a/DefaultKeyBinding.dict +++ b/DefaultKeyBinding.dict @@ -53,9 +53,9 @@ "/" = (setMark:, moveToBeginningOfParagraph:, insertText:, "// ", swapWithMark:, moveRight:, moveRight:, moveRight:); // comment with "#" "\\" = (setMark:, moveToBeginningOfParagraph:, insertText:, "# ", swapWithMark:, moveRight:, moveRight:); - // TODO HTML COMMENTING + // Html Commenting "!" = (setMark:, moveToBeginningOfParagraph:, insertText:, "<!-- ", moveToEndOfParagraph:, insertText:, " -->", swapWithMark:, moveRight:, moveRight:, moveRight:, moveRight:, moveRight:); - // TODO CSS COMMENTING + // Css Commenting "*" = (setMark:, moveToBeginningOfParagraph:, insertText:, "/* ", moveToEndOfParagraph:, insertText:, " */", swapWithMark:, moveRight:, moveRight:, moveRight:); }; @@ -84,30 +84,33 @@ "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](|)" - // TODO: after using this, if you insert a link with nothing selected, it uses your last kill buffer. Need a way to clear that buffer if there's no selection. - "t" = (setMark:, swapWithMark:, deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, insertText:, " ", moveLeft:, insertText:, "]()", moveRight:, deleteBackward:, moveLeft:, setMark:, insertText:, "http://", selectToMark:); // link text + "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 "[|selected text](clipboard contents)" - "c" = (setMark:, swapWithMark:, deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, setMark:, insertText:, " ", moveLeft:, insertText:, "](", pasteAsPlainText:, insertText:, ")", moveRight:, deleteBackward:, swapWithMark:); // link with clipboard + "c" = (setMark:, breakUndoCoalescing:, moveRight:, insertText:, " ", deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, moveLeft:, insertText:, "](", setMark:, pasteAsPlainText:, insertText:, ")", moveRight:, deleteBackward:, moveLeft:, selectToMark:); // link with clipboard }; // image "i" = { // link as image // same as lt, but with image syntax "" + // TODO: Apply the fix from l,t/c above to avoid inserting the kill buffer when there's no selection "t" = (setMark:, swapWithMark:, deleteToMark:, insertText:, "![", yank:, insertText:, " ", moveLeft:, insertText:, "]()", moveRight:, deleteBackward:, moveLeft:); // image link for text - // same as lc, but with image syntax "" + // same as lc, but with image syntax "" "c" = (setMark:, swapWithMark:, deleteToMark:, insertText:, "", moveRight:, deleteBackward:, swapWithMark:); // image with clipboard }; // references ":" = { - // without selected text first, these make a mess // 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:); }; - // insert reference link + // insert reference link [selection][|] "[" = (setMark:, swapWithMark:, deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, insertText:, " ", moveLeft:, insertText:, "][]", moveRight:, deleteBackward:, moveLeft:); + // insert reference [selection]: | + "]" = (setMark:, swapWithMark:, deleteToMark:, insertText:, " [", moveLeft:, deleteBackward:, moveRight:, yank:, insertText:, " ", moveLeft:, insertText:, "]: ", moveRight:, deleteBackward:, deleteForward:); // lists "+" = (setMark:, moveToBeginningOfParagraph:, insertText:, "+ ", swapWithMark:, moveRight:, moveRight:); |
