What’s the shortcut for “Edit All in Scope” in Xcode?

Xcode

Xcode Problem Overview


In Xcode, there's a feature to edit variables or codes within a scope:

Scope editing

In my IDE, this feature only works when I move my mouse over a variable. Most of the time, I don’t get this feature. Since it’s fairly useful, I’d like to use it more often.

Is there a keyboard shortcut for this? (Please don’t tell me to use “Find and replace”.)

Xcode Solutions


Solution 1 - Xcode

Menu: Editor -> Edit All In Scope (also shows key binding)

Keyboard Shortcut: Control-Command-E

If you want you can change this key binding on Preferences -> Key Bindings -> search for "Edit all in scope".

EDIT: In Xcode 9, you may want to instead use the fabulous new "Rename…" functionality, which works across classes, also renames files and comments, and gives you a neat preview. As of beta 2, this does not have a default keyboard shortcut, but you can easily give it one.

Solution 2 - Xcode

Press Cmd-Ctrl-E to edit all in scope

Solution 3 - Xcode

For xCode 9 there is not default hotkey for Refactor > Rename

enter image description here

But you can setup it:

for instance, Ctrl + Shift + R

enter image description here

Solution 4 - Xcode

After xCode 8.3 you may also need to,

  • check Highlight instances of selected symbol option in Preferences - Text Editing pane

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMidhun MPView Question on Stackoverflow
Solution 1 - XcodefzwoView Answer on Stackoverflow
Solution 2 - XcodeJohn HenckelView Answer on Stackoverflow
Solution 3 - XcodeVyacheslavView Answer on Stackoverflow
Solution 4 - XcodeAashishView Answer on Stackoverflow