在现代的ide中,有一个键盘快捷键,可以通过输入文件名称来打开文件,而不用把手放在鼠标上。例如:
Eclipse: Cmd|Ctrl + Shift + R ->打开资源 IntelliJ: Cmd|Ctrl + Shift + N ->打开文件
Xcode中有“转到文件”或“打开文件”快捷方式吗?
在现代的ide中,有一个键盘快捷键,可以通过输入文件名称来打开文件,而不用把手放在鼠标上。例如:
Eclipse: Cmd|Ctrl + Shift + R ->打开资源 IntelliJ: Cmd|Ctrl + Shift + N ->打开文件
Xcode中有“转到文件”或“打开文件”快捷方式吗?
当前回答
如果您想跳转到特定文件中的特定行。 然后
第一: Command + Shift + o
然后输入 CustomView: 60
表示在文件CustomView第60行。
其他回答
因为Xcode 4(包括5、6、7、8、9、10、11、12和13)是⌘+⇧+ O
文件→快速打开…
你可以在Preferences→Key Bindings中为它指定一个快捷方式。默认值为⌘+Shift+D。
(如果您有#include/#import,您可以将文本光标放在上面,并按⌘+Shift+D自动填充文件名。)
更新到Xcode 9.3
这是所有Xcode键盘快捷键的快速指南:
Comment/ Un-comment code: ^ + / Undo: ⌘ + Z Redo: ⌘ + ⇧ + Z Shift Right or Left: ⌘ + [ | ] Indent: ⌃ + I Navigate to the beginning or end of line: ⌘ + ← | → Navigate word by word left or right of line: ⌥ + ← | → Bring up possible auto-completion choices: esc Jump To definition: ⌘ + Click Put a breakpoint to a line: ⌘ + \ Move line up or down: ⌘ + ⌥ + [ | ] Find in File: ⌘ + F Find & Replace in File: ⌘ + ⌥ + F Find in Project: ⌘ + ⇧ + F Find & Replace in Project: ⌘ + ⌥ + ⇧ + F New Tab: ⌘ + T Next Tab: ⌘ + ⇧ + { Previous Tab: ⌘ + ⇧ + } Open Quickly: ⌘ + ⇧ + O Move Focus to Editor: ⌘ + J Navigate to Next File in Recently Visited: ⌘ + ⌃ + → Navigate to Previous File in Recently Visited: ⌘ + ⌃ + ← Show present file in Editor: ⌘ + ⇧ + J Fold/ Unfold code: ⌘ + ⌥ + ← | → Fold/ Unfold all methods/functions: ⌘ + ⌥ + ⇧ + ← | → Fold/ Unfold all multiple line comments: ⌃ + ⇧ + ⌘ + ← | → Font Size Increase/Decrease: ⌘ + + | - Go to line number: ⌘ + L Show Assistant Editor: ⌘ + ⌥ + Return Hide Assistant Editor: ⌘ + ↩ Toggle Completions: ⌃ + Space Edit All in Scope: ⌘ + ⌃ + E Show / Hide Navigator: ⌘ + 0 Switch Tabs: ⌘ + 1 - 8 When clicking a File in Navigator open in Assistant Editor: ⌥ + Click New Window: Double click Decide where to open: ⇧ + ⌥ + Click Toggle Debug Area: ⌘ + ⇧ + Y Next Issue: ⌘ + ’ Previous Issue: ⌘ + ” Toggle Breakpoints: ⌘ + Y Clear Console: ⌘ + K Show / Hide Utilities: ⌘ + ⌥ + 0 Switch Tabs Utilities: ⌘ + ⌥ + 1 - 9 Build: ⌘ + B Run: ⌘ + R Stop: ⌘ + . Analyze: ⌘ + ⇧ + B Test: ⌘ + U Clean: ⌘ + ⇧ + K Help for Clicked Symbol: ⌥ + click Documentation for clicked Symbol: ⌥ + Double click Show Documentation: ⌘ + ⇧ + 0 Documentation for Selection: ⌘ + ⌥ + ⌃ + / Move Focus to Filter in Navigator: ⌘ + ⌥ + J Move Focus to Filter in Utilities: ⌘ + ⌥ + L
Command + Shift + O现在是快速找到一个文件并在Xcode 4中打开它的快捷方式
还需要注意的是,如果你按住Command并点击一个类的名称,Xcode会跳转到这个类的实现。