OS X Users: Get This Now.

Everyone else, go buy a Mac.

Michael McCracken made the world a better place back in February, and I only just found out.

Incremental Search, or i-search, is the magic that powers Firefox‘s in-page search. It’s been around for years in emacs. If you haven’t seen it (why aren’t you using Firefox?), the search takes place in real time, as you type. I miss it in other apps… but not any more.

Michael’s I-Search plugin for NSTextView is a library (a bundle in Cocoa-speak) that adds i-search to all NSTextViews – which is nearly every bit of text you see in an OS X Cocoa application. You just drop the bundle and a keybindings file into a couple of special folders in ~/Library and you’re all set. TextEdit, XCode, and SubEthaEdit all have i-search now.

If you only know i-searching from Firefox, you should note that the I-Search Plugin uses emacs keybindings, not Firefox’s. To begin searching, use ctrl-s. To see the next match, press ctrl-s again (why does Firefox use a second keycombo for this?). To search backwards, use ctrl-r. To exit i-search and return your cursor to it’s pre-search location, press ctrl-g. To exit i-search and keep the current match selected, press return (or esc). Having pressed return or esc, you can return to your pre-search location with ctrl-x ctrl-x (yes, do it twice). You can even make an edit first. In emacs terms, i-search updates the mark before searching. Since Cocoa text editing supports many emacs features and keybindings, it works as expected. (If you don’t know what the last two sentences mean, don’t worry about it.)

Both comments and pings are currently closed.

One Response to “OS X Users: Get This Now.”

  1. chornbe Says:
    • bookmarks this so I can get it after I get my new iMac in a couple of weeks *

    PS… check your cookies – this page never remembers my info.