In Xcode, there's a feature to edit variables or codes within a scope:
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”.)
command + option + [ or ] to move a line of code up and down.
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.
Press Cmd-Ctrl-E
to edit all in scope
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With