Mac

About the Mac category

Note: I’m doing most of my Macintosh-related writing at O’Reilly’s MacDevCenter nowadays. Here’s my author page over there.

Vi Input Manager for Cocoa text fields

By Jason Corso. Updated earlier this year to work with Leopard.

Vi Input Manager

This bundle patches the Cocoa Text System to add a Vi-like command mode. After entering command-mode (typically, by hitting escape in Vi), ordinary Vi commands can be typed and the text field will be updated accordingly. Essentially, this add Vi command functionality (albeit a small subset) to any (and all) text editors that use the Cocoa text system; e.g., Safari, TeXShop, XCode, etc. Note, however, this does not work for other programs that do not use the Cocoa system.

Useful Unix, Vim, and Emacs tricks on Slashdot

cartoon of vi man beating up feeble emacs user

A couple of days ago, Slashdot posted a story asking about “(Useful) Stupid Unix Tricks?”:

So the other day I messaged another admin from the console using the regular old ‘write’ command (as I’ve been doing for over 10 years). To my surprise he didn’t know how to respond back to me (he had to call me on the phone) and had never even known you could do that. That got me thinking that there’s probably lots of things like that, and likely things I’ve never heard of. What sorts of things do you take for granted as a natural part of Unix that other people are surprised at?

It’s perhaps unsurprising that there have been over 2200 comments exploring the arcana of the Unix and Unixy command line. A lot of awesome lore to check out.

Yesterday came the next story, “(Useful) Stupid Vim Tricks?”:

I thoroughly enjoyed the recent post about Unix tricks, so I ask Slashdot vim users, what’s out there? :Sex, :b#, marks, ctags. Any tricks worth sharing?

570+ comments later, there’s a lot to check out there as well.

Today’s post was inevitable, “(Stupid) Useful Emacs Tricks?”:

Since the Vi version of this question was both interesting and popular, let’s hear from the other end of the spectrum. What are your favorite tricks, macros, extensions, and techniques for any of the various Emacs? Myself, I like ‘M-x dunnet’ ;-)

200 comments and counting.

One of the most enjoyable parts of the Vim story, apart from the various spiffy command tips and tricks, were links to other sites. Here are a couple, along with a few related others I’ve linked to before.

Command line tea timer for Mac

Cuppa is a spiffy tea timer program for Mac (if only for its sound effects ;), itself inspired by The Tea Cooker from Linux. However, there’s an easy way to create a de facto tea timer, or run any kind of countdown, via the Terminal.

The sleep command allows you to run other commands or programs with a delay. So, for example, you could enter,

sleep 20; ps

which will pause for 20 seconds, then run ps to show your active tasks.

To keep you from having to stare at the Terminal window waiting for your tea countdown to finish, we’ll make use of the say command, which taps into your Mac’s built-in Text-to-Speech ability. (See System Preferences > Speech.)

So, assuming you want your Earl Grey to steep for four minutes, you could use something like this:

sleep 240; say "Your Tea, Earl Grey, Hot, has completed brewing."

Or for your Green Tea:

sleep 60; say "Green Tea processing complete."

Enjoy!

Chrome is burning

No word on when a Mac version of Chrome will be available, so exploring the intriguing new browsing features will have to wait. Thhppth.

Still, lots of resources and folderol to check out:

Syndicate content