Category: Code


  • I do most of my automation and string manipulation scripting using Ruby. I know it’s not the most popular language these days, but it’s the one I know the best (thanks to my days of hacking on TextMate bundles) and it’s usually the fastest way for me to solve a problem. I have reams of…

  • Multi-keystroke keybindings

    Ok, this one will probably wrap up this little run of key binding tricks. It’s been fun, though, and I’d love to answer any questions I can in the forum. If you’ve ever examined my master DefaultKeyBinding.dict (or even looked at the readme), you’ll see that I make use of a lot of multi-stroke key…

  • Another trick for readers interested in honing their keyboard-fu on macOS. In Vim, most operations have can have a count specified in the keystrokes for the command, e.g. 3dd to delete 3 lines. You can do similar in any Cocoa text field (all Apple apps, plus most native apps). You just need to specify a…

  • So you may have seen my KeyBindings project before. It’s an insanely large collection of keybinding tricks that work in any macOS text field. Well, any native cocoa field. You won’t have much luck in Electron or other non-native text editors. But for most uses, including in Safari, Mail, Notes, nvUltra, and most of the…

  • This post will only be of interest to people writing scripts in Ruby. Seriously, zero utility if you’re not using Ruby. Though I would be curious how you accomplish the same thing in other languages like Rust and Python, because I’ve never gotten too deep with string manipulation in anything other than Ruby, Swift, and…

  • The latest version of mdless, my most recent coding obsession, now includes MultiMarkdown document transclusion. File transclusion is the ability to tell MultiMarkdown to insert the contents of another file inside the current file being processed. You can include a document by inserting a relative path between two pairs of curly brackets: {{myfile.md}} The path…