BBEdit finding

BBEdit’s system for finding text is both flexible and easy to understand, but it can be inefficient if you don’t use keyboard shortcuts for switching between its options. I suspect many BBEdit users don’t even know the shortcuts exist.

You bring up the Find window through either the Search‣Find… menu command or the ⌘F shortcut. All of the checkboxes and buttons in the Find window have keyboard shortcuts, which you can see, one at a time, by hovering over them. I think it’s better, though, if you can see them all at once:

BBEdit Find shortcuts

To me, the most important items are the checkboxes along the bottom. The state of the checkboxes is whatever state you left them in during your last search. Because I frequently change the type of searching I do, being able to quickly change the state of those checkboxes is the key to efficient searching. If you find the screenshot a little too small to read comfortably, here’s a table with both the default shortcuts and mine.

Checkbox Default shortcut My shortcut
Case sensitive ⌃⇧N ⌃⇧C
Entire word ⌃⇧E ⌃⇧E
Grep (regex)1 ⌃⇧G ⌃⇧G
Selected text only ⌃⇧S ⌃⇧S
Wrap around ⌃⇧W ⌃⇧W

They all use the ⌃⇧ prefix, and most of them use the first letter of their label by default. The only one I changed is the one for case sensitive searching. I just never could train myself to associate that with N, so I changed it to C in BBEdit’s shortcuts settings:

BBEdit Find Window shortcut preferences

I confess I almost never use saved patterns, accessible through the popup menu labeled with a g,2 but I often find myself bringing back search patterns that I used just a few minutes ago. For that, the history popup (with the clock logo) can be a big timesaver. Type ⌃⇧H and then arrow down through the list of old searches until you hit the one you want to reuse.

BBEdit Find history

The action buttons along the right side of the window all use ⌘ as part of the prefix. The Next button uses, in addition to the Return key, ⌘G, which Mac users should recognize as the standard “Find Again” key. Similarly, the Previous button uses ⇧⌘G, which is also commonly used as the “Find Again, But Backwards” key.

By the way, do you know about the ⌘E shortcut? In BBEdit, it’s explicitly shown as the shortcut for the Search‣Use Selection for Find command, but it works in most Mac programs. Select some text, hit ⌘E, and the text will be put on the “find pasteboard.” Subsequent taps of ⌘G will search forward for that text (and ⇧⌘G will search backward for it). Using the ⌘E/⌘G combination is a very efficient way to find later instances of a string. I use them all the time to quickly move from where a function is defined to where it’s called. And, as I said, it’s available in most Mac programs.

Finally, we come to BBEdit’s Search‣Live Search command, which has a keyboard shortcut of ⌥⌘F.3 This brings up a little text field below the title bar for you to enter the search string. As you type, it tells you how many matches there are, the matches are highlighted in the document, and you can move from one match to another by either clicking on the arrow buttons or hitting Return (to move forward) or Shift-Return (to move backward).

BBEdit Live Search

Live Search, like the ⌘E/⌘G combo, can be faster than bringing up the Find window, but that speed comes at the cost of some flexibility. Live Search is always case-insensitive and does plain text searching only—no regular expressions allowed. It does, however, wrap around regardless of your last setting in the Find window, which is handy.

The reason I don’t bother with simple text editors, even those that have nice features like live Markdown formatting, is that their limited capabilities keep you at a beginner level, no matter how long you’ve been using them. Serious text editors have a depth that rewards their users.

Update 12/14/14 3:18 PM
Here’s a Twitter discussion on the history of the ⌘E shortcut.

  1. Personally, I think Grep should be called Regex because Regex is more descriptive, but I know BBEdit has a decades-long history of calling it Grep, so there’s no way it’ll be changed now. 

  2. I’m sure there’s a good reason to label this button g, but I don’t know what it is. Maybe that’s part of the reason I don’t use it. 

  3. Or ⌃S, which BBEdit inherited from Emacs.