Xcode 中“Edit All in Scope”的快捷方式是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17115413/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:50:34  来源:igfitidea点击:

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

xcode

提问by Midhun MP

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

在 Xcode 中,有一个功能可以在范围内编辑变量或代码:

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.

在我的 IDE 中,此功能仅在我将鼠标移到变量上时才有效。大多数时候,我没有得到这个功能。由于它相当有用,我想更频繁地使用它。

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

是否有键盘快捷键?(请不要告诉我使用“查找和替换”。)

回答by fzwo

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

菜单:Editor -> Edit All In Scope(也显示键绑定)

Keyboard Shortcut:Control-Command-E

键盘快捷键:Control- Command-E

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

如果您愿意,您可以在 Preferences -> Key Bindings -> 搜索“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.

编辑:在 Xcode 9 中,您可能希望改用全新的“重命名...”功能,该功能可跨类工作,还可以重命名文件和注释,并为您提供简洁的预览。从 beta 2 开始,它没有默认的键盘快捷键,但您可以轻松地给它一个。

回答by John Henckel

Press Cmd-Ctrl-Eto edit all in scope

按下Cmd-Ctrl-E可编辑范围内的所有内容

回答by Vyacheslav

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

对于 xCode 9,重构 > 重命名没有默认热键

enter image description here

在此处输入图片说明

But you can setup it:

但是你可以设置它:

for instance, Ctrl + Shift + R

例如, Ctrl + Shift + R

enter image description here

在此处输入图片说明

回答by Aashish

After xCode 8.3 you may also need to,

在 xCode 8.3 之后,您可能还需要,

  • check Highlight instances of selected symboloptionin Preferences- Text Editingpane
  • 在-窗格中检查 Highlight instances of selected symbol选项PreferencesText Editing

enter image description here

在此处输入图片说明