Take the 2-minute tour ×

In Visual Studio—my main squeeze for many years—I can press Ctrl+F to immediately search for the identifier or string that my text caret is touching, or else the currently selected text if I have a selection. I can press Ctrl+Shift+F to search the whole project, solution, or other file sets. I like this.

In Xcode 3.*—my main squeeze in recent years—I could press Cmd+Opt+F to immediately search for the currently selected text and Cmd+Opt+Shift+F (a bit of a handful, but workable), to search throughout the project. I liked this a bit less than the VS approach because I first had to select some text, then search for it, rather than the IDE automatically picking up the current identifier for me if I hadn't selected anything. But it was fine.

Now in Xcode 4 I notice that there is a Cmd+E shortcut that makes Xcode "Use Selection for Find." But it... well it sucks bad. All it does--apparently--is to copy the current selection and paste it into the find box. It doesn't show the find box, so if the find box isn't currently shown then Cmd+E has no visible effect. Cmd-E does not actually invoke the search--it only copies the text. So now searching for an identifier becomes a three step process: select the identifier, press Cmd+E, press Cmd+F (or Cmd+Shift+F for project-wide search).

IMO, Xcode 4's three-step process is worse than Xcode 3's two-step process, which is worse than Visual Studio's one-step process.

My question: In light of this falling UI efficiency along with recent international events, is the world just going downhill and soon all will end in a fiery apocalypse in which the few remaining humans will be forced to retype War and Peace each time they want to search for an identifier?

share|improve this question
Xcode 4's process is the normal mac process. You can find the next match without showing the find box using cmd+g (shift to go backwards) –  ughoavgfhw Mar 16 '11 at 19:31
That helps. I've used Macs for about 3 years and hadn't noticed that that interface is in TextEdit, Pages, and who knows what else. Two key commands is definitely better than three. Maybe the world isn't ending after all. –  OldPeculier Mar 16 '11 at 20:32
add comment

1 Answer

up vote 24 down vote accepted

ughoavgfhw offered the correct answer (above). Use Cmd+E on the highlighted text to begin searching with that text. Then immediately type Cmd+G to jump to the next instance of the searched-for text in the current file. Or immediately type Cmd+Shift+F to search the whole project for all instances of the text.

This is quite quick, consistent, and sensible. It's not as immediate as Visual Studio's single-stroke Find/Find-in-Files—Xcode requires two strokes rather than one—but personally the extra step doesn't bother me.

share|improve this answer
It bothers me! Thanks for the answer though. +1 –  Nate Cook May 30 '13 at 23:35
add comment

Your Answer


