Topic: https://brettterpstra.com/2011/08/13/keybinding-madness/
hide preview

What's next? verify your email address for reply notifications!

Jack Brannen 13y, 101d ago

Thanks, Brett!

hide preview

What's next? verify your email address for reply notifications!

Jack Brannen 13y, 102d ago

I’d love to use this file, but I need to modify it first, since some of the keybindings it overwrites are essential to my workflows… BUT unfortunately I really don’t know enough to do that. Can anyone help me translate the symbols in the .dict file? So far, I THINK I’ve figured out these three:

⌃ ctrl
~ opt
@ cmd

…But that doesn’t account for everything, and there still seem to be quite a few things I can’t make sense of. I’d really appreciate any help. Thanks!

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 101d ago

You have 3 out of 4. The $ is used for shift when you can't just capitalize a letter.

hide preview

What's next? verify your email address for reply notifications!

BJ 13y, 176d ago

I can't seem to find the Keybindings folder in Lion. Where should I put the file?

remark link
hide preview

What's next? verify your email address for reply notifications!

Brian 13y, 175d ago

Same here... I can't find the KeyBindings folder!

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 175d ago

If it doesn't exist, you can just create it at ~/Library/KeyBindings (note the capitalization).

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Brian 13y, 175d ago

Thanks, Brett.

By the way: I really love what you do for the community — amazing work with TextExpander, Markdown, Services, etc... I really enjoyed the text geekery podcast at MacPowerUsers recently, too. And Marked rocks!
Thanks again!

hide preview

What's next? verify your email address for reply notifications!

Lauri Ranta 13y, 220d ago

Apparently it depends on the Markdown variant. Markdown.pl doesn't interpret backslash-backtick as a literal backtick outside code blocks. The multimarkdown executable, multimarkdown2XHTML.pl (used by Marked and nvALT) and the variants used by Stack Overflow and Github do though.

Those commented out macros worked fine for me after I changed \U000A to \U000D. It could be something specific to your installation or account.

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 220d ago

Looks like you're right, just tested again with \U000D and it works great. Thanks for the assist!

hide preview

What's next? verify your email address for reply notifications!

Lri 13y, 220d ago

Apparition, WTF. So, I'm a cs.helsinki.fi 'freshman / dropout' who spends way too much time doing stuff like configuring DefaultKeyBindings and lurking at Stack Exchange sites. So. I have never even touched an iOS device 'in real life'. Not female, mystery over.

The keybindings at my site were made for a custom keyboard layout (Snoboard), so some of them might not work on other layouts. For example dead keys (⌥e, ⌥u, ⌥i, ⌥n and ⌥&#092` on the US layout) have precedence over KeyBindings and would have to be removed from the .keylayout before they can be reassigned.

TextMate doesn't support marks, so it breaks many of both Terpstra's and my macros. TM has its own KeyBinding plist and more available selectors though: cp /Applications/TextMate.app/Contents/Resources/KeyBindings.dict ~/Library/Application\ Support/TextMate/KeyBindings.dict.


// TextMate Command-Return (I wish this worked in some form, but it doesn't seem to)
// "@&#092U000A" = (moveToEndOfParagraph:, insertNewline:);
// "@$&#092U000A" = (moveToBeginningOfParagraph:, moveLeft:, insertNewline:);


That's coz \U000A (LF) is used for ⌤ / enter, and &#092U000D (CR) for ↩ / return. (They're the other way around on Jacob Rus's site though.)

remark link
hide preview

What's next? verify your email address for reply notifications!

Donald 13y, 218d ago

yes, apparition seems to be the right word, if the following is true:

snoboard is a layout you made and something you use regularly?

and yes, you have some crazy ass applescript on your site and your documentation is really inspiring. more people need to take such notes. I am going to start being more rigorous. Right now I just have a few refx shell.md like files keeping commands i used once and rarely use. But your applescript stuff is really useful. It might be well suited as a git repository though so it's more accessible and guaranteed to be around.

don't worry about college, doing what you're doing is more important in the end as long as you keep coding. you'll learn more messing around by yourself.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Lauri Ranta 13y, 217d ago

I have just a few notes for shell oneliners and reference material as well, but each is thousands of words long. (FU Scrod's way of using NV.)

I don't know about having a git repository for the AppleScript pack. The site (lri.me) is sort of an experiment in publishing everything on single static pages. So far I don't have anything (like actual programming projects that would benefit from being at a VCS) that would need to be published elsewhere.

hide preview

What's next? verify your email address for reply notifications!

Lri 13y, 220d ago

So. Um. Your Wordpress doesn't backslash-escape &#092`backticks'. Obvious bug.

remark link parent
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 220d ago

Not a bug, it's Markdown, which interprets the backtick as the beginning of a code span :).

I hope you didn't take any offense, it's just that for as meticulous and relatively prolific as your code is, you have a bit of a mysterious online presence. I'm honored that you're hanging around here.

What I meant by "I wish this worked in some form..." wasn't the shortcut, it's the action. The moveToEndOfParagraph:, insertNewline: seems to have no effect no matter what I bind it to.

hide preview

What's next? verify your email address for reply notifications!

h1ro 13y, 220d ago

very nice to have these on github. have you ever figured out a way to have the TextMate keybinding of "showContextMenu" binding in any other application or something along those lines?

when i'm editing text being able to pop up the context menu without having to reach for a mouse is such a time saver

remark link
hide preview

What's next? verify your email address for reply notifications!

aristidesfl 12y, 278d ago

I wold love this showContextMenu too..

hide preview

What's next? verify your email address for reply notifications!