21
votes

Does XCode 4 have keyboard shortcut for the two menu options: Edit > Find > Replace and Find Next / Previous?

If not, (1) why not, (2) how do I create them, and (3) which key combinations do you recommend for the shortcuts?

3

3 Answers

42
votes

As for Find & Replace, they are provided by default now (version 4.2.1):

Find & Replace: Cmd + Option + F
Find & Replace in Workspace: Cmd + Option + Shift + F

14
votes

As for Find next/Find previous, you should be able to use standard Cmd-G and Cmd-Shift-G Mac shortcuts.

But the keyboard shortcut for Edit > Find > Replace doesn't seem to be provided by default. However, you can set up one if you go to XCode 4 Preferences (Cmd-,) and then click Key Bindings. There are options available for Replace, Replace All as well as Replace and Find Next.

4
votes

You can do that by

Find & Replace: Cmd + Option + F
Find & Replace(in Workspace): Cmd + Option + Shift + F.

Also you can change this control as per your preference by following these steps:
1. Xcode > Preferences
2. Select Key Bindings
3. Search for command you want to replace and then add a suitable combination.

Refer to the attached Image.enter image description here

Hope it helps. All the best