1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
{
/* # Extra default keybindings for cocoa text fields: #
*
* ## Files: ##
*
* /System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict
* ~/Library/KeyBindings/DefaultKeyBinding.dict
*
* ## Terminal Commands ##
*
* defaults write -g NSTextKillRingSize -string 4
* defaults write -g NSRepeatCountBinding -string "^u" -- I'm gonna use a different key
*
* This creates a 'kill ring' with size 4, and binds C-u for repeated commands
*
* ## Some useful links: ##
*
* - Apple developer docs:
* http://developer.apple.com/documentation/Cocoa/Conceptual/InputManager/Concepts/KeyBindings.html
* http://developer.apple.com/documentation/Cocoa/Conceptual/BasicEventHandling/Tasks/TextDefaultsAndBindings.html
* http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSResponder.html
*
* - Good Overview at Llew Mason's http://www.lsmason.com/
* http://www.lsmason.com/articles/macosxkeybindings.html
*
* - IncrementalSearchInputManager:
* http://michael-mccracken.net/software/I-Search plugin.zip
*
* - http://www.snark.de/, and particularly:
* http://www.snark.de/files/defaultkeybinding.dict
*
* - http://gnufoo.org/macosx/macosx.html
*
* - NISUS Mailing list archive page:
* http://listserv.dartmouth.org/scripts/wa.exe?A2=ind0301&L=nisus&D=0&F=P&T=0&P=29262&F=
*
* - A preference pane for changing key bindings -- I don't use it, but...
* http://www.mai.liu.se/~milan/TextMacro/
*
* - Some further useful actions can be added with Mike Ferris' TextExtras input manager:
* http://www.lorax.com/FreeStuff/TextExtras.html
*
*/
/* Emulated TextMate commands:
**************************************************************************/
/* This command will let Ctrl-Shift-, turn the previous word *
* into an HTML/XML opening and closing tag pair. */
"^<" = ( "setMark:", /* C-Shft-, Make html tag */
"moveWordBackward:",
"deleteToMark:",
"insertText:", "<",
"yank:",
"insertText:", ">",
"setMark:",
"insertText:", "</",
"yank:",
"insertText:", ">",
"swapWithMark:");
/* Jacob's awesome bindings: why oh why does the world draw from emacs?
**************************************************************************/
"^w" = "deleteToMark:";
"^e" = "deleteToEndOfParagraph:";
"^r" = "deleteToBeginningOfParagraph:";
"^d" = "deleteForward:";
"^f" = "deleteBackward:";
"^s" = "ISIM_incrementalSearch:";
"^S" = "ISIM_reverseIncrementalSearch:";
"^t" = "transpose:";
"^T" = "transposeWords:";
"^g" = "centerSelectionInVisibleArea:";
"^h" = "noop:"; /* to be NSRepeatCountBinding? */
"^y" = "yankAndSelect:";
/* Navigation */
"^c" = "pageUp:";
"^v" = "pageDown:";
"^i" = "moveUp:";
"^j" = "moveBackward:";
"^k" = "moveDown:";
"^l" = "moveForward:";
"^u" = "moveWordBackward:";
"^o" = "moveWordForward:";
"^n" = "moveToBeginningOfParagraph:";
"^;" = "moveToEndOfParagraph:";
/* Mark point stuff */
"^m" = "setMark:";
"^," = "selectToMark:";
"^." = "swapWithMark:";
/* Paging up and down */
"\UF729" = "moveToBeginningOfDocument:"; /* home Move to beginning of document */
"\UF72B" = "moveToEndOfDocument:"; /* end Move to end of document */
"$\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
/* Shft-home Select to beginning of document */
"$\UF72B" = "moveToEndOfDocumentAndModifySelection:";
/* Shft-end Select to end of document */
"@\UF729" = ( "moveBackward:", /* A-home Move to beginning of paragraph */
"moveToBeginningOfParagraph:");
"@\UF72B" = ( "moveForward:", /* A-end Move to end of paragraph */
"moveToEndOfParagraph");
"$\UF72C" = "pageUpAndModifySelection:"; /* Shft-Pgup Select page up */
"$\UF72D" = "pageDownAndModifySelection:"; /* Shft-Pgdn Select page down */
/****** From BBEdit ******/
// /* Scrolling */
// "^\UF700" = "scrollLineUp:"; /* C-up Scroll up */
// "^\UF701" = "scrollLineDown:"; /* C-down Scroll down */
// "@^\UF700" = ( "scrollLineUp:", /* A-C-up Scroll up 2 lines */
// "scrollLineUp:");
// "@^\UF701" = ( "scrollLineDown:", /* A-C-down Scroll down 2 lines */
// "scrollLineDown:");
// "~^\UF700" = ( "scrollLineUp:", /* O-C-up Scroll up 3 lines */
// "scrollLineUp:",
// "scrollLineUp:");
// "~^\UF701" = ( "scrollLineDown:", /* O-C-down Scroll down 3 lines */
// "scrollLineDown:",
// "scrollLineDown:");
// "@~^\UF700" = ( "scrollLineUp:", /* A-0-C-up Scroll up 6 lines */
// "scrollLineUp:",
// "scrollLineUp:",
// "scrollLineUp:",
// "scrollLineUp:",
// "scrollLineUp:");
// "@~^\UF701" = ( "scrollLineDown:", /* A-O-C-down Scroll down 6 lines */
// "scrollLineDown:",
// "scrollLineDown:",
// "scrollLineDown:",
// "scrollLineDown:",
// "scrollLineDown:");
/* Page up-down */
"~\UF700" = "pageUp:"; /* O-up Page up */
"~\UF701" = "pageDown:"; /* O-down Page down */
"~$\UF700" = "pageUpAndModifySelection:"; /* O-Shft-up Select page up */
"~$\UF701" = "pageDownAndModifySelection:"; /* O-Shft-down Select page down */
/* delete backward/forward */
"$\U007F" = "deleteForward:"; /* Shft-Del Delete forward */
"~\U007F" = "deleteWordBackward:"; /* O-Del Delete word backward */
"~\UF728" = "deleteWordForward:"; /* O-FwdDel Delete word forward */
"~$\U007F" = "deleteWordForward:"; /* O-Shft-Del Delete word forward */
/********************* Other keybindings *********************/
/* Modifier keys: start with C-p */
"^p" = {
"^ " = ("insertText:", "\U2423"); /* C-space space */
"^e" = ("insertText:", "\U21A9"); /* C-e return */
"e" = ("insertText:", "\U2305"); /* e enter */
"^t" = ("insertText:", "\U21E5"); /* C-t tab */
"t" = ("insertText:", "\U21E4"); /* t backtab */
"^d" = ("insertText:", "\U232B"); /* C-d delete */
"d" = ("insertText:", "\U2326"); /* d forward delete */
"^x" = ("insertText:", "\U238B"); /* C-x escape */
"x" = ("insertText:", "\U23CF"); /* x eject */
"^a" = ("insertText:", "\U2318"); /* C-a command (apple) */
"^o" = ("insertText:", "\U2325"); /* C-o option */
"^c" = ("insertText:", "\U2303"); /* C-c control */
"^s" = ("insertText:", "\U21E7"); /* C-s shift */
"s" = ("insertText:", "\U21EA"); /* s caps lock */
"c" = ("insertText:", "\U2038"); /* c caret */
"^h" = ("insertText:", "\U2196"); /* C-h home */
"h" = ("insertText:", " |
Pastie