20

Is it possible to find and replace in selected text in Snow Leopard Xcode 3.2? There always use to be an option for selected text. Really frustrating. Thanks.

RunLoop
  • 20,288
  • 21
  • 96
  • 151

4 Answers4

58

Yeah, but it's a lot less obvious now. If you have the "Find" bar up, change the first dropdown menu to "Find & Replace". Then, if you hold option, the "Replace All" button turns into an "In Selection" button.

No Surprises
  • 4,831
  • 2
  • 27
  • 27
  • 1
    Aah, the magic option button. They should tell us about this stuff. Thanks, saved my day (and about 5 other programmers in the room here). – damian Jan 15 '11 at 18:22
  • 4
    No problem. Apparently, to do something on your Mac that should be possible but doesn't seem possible, try Option. Another example: maximizing iTunes using the green + button. – No Surprises Jan 17 '11 at 23:29
2

In XCode 5 and earlier you can highlight a word and hit CMD+CTRL+E and then simply edit the word in line and it applies your edit to all occurrences of that word in the document.

Travis M.
  • 10,930
  • 1
  • 56
  • 72
2

You can press Command+Ctrl+F to bring up directly the Find & Replace bar, and press Escape to remove it. I don't think there's anyway to activate the "Replace All" button using the keyboard, but then again there never was afaik.

Aidan
  • 21
  • 1
2

Sometimes an image helps make things a little easier to grasp quickly. So this is to supplement the chosen answer.

enter image description here

enter image description here

And holding down Option:

enter image description here

Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393