XCode 是否有像 Visual Studio 一样的光标导航堆栈?
Visual Studio 跟踪光标位置并允许您在这些位置之间向前和向后移动。 例如,您可以键入 Ctrl+- 向后导航,按 Ctrl+Shift- 向前导航。
我看到 XCode 跟踪您访问过的文件的历史记录,但它是否也允许我在光标位置前进和后退?
我之所以问这个问题,是因为我发现通过使用 Command-双击左键,我可以访问函数定义(通常在同一个文件中),然后我想快速返回到之前在同一个文件中的位置。 因为我位于同一个文件中,所以文件历史记录导航没有用。 目前我必须搜索代码才能找出我在哪里,这很乏味。
谢谢!
Visual Studio tracks cursor positions and lets you move forward and backward through these positions. For example, you can type Ctrl+- to navigate backwards and Ctrl+Shift- to navigate forwards.
I see that XCode tracks the history of which files you've visited, but does it also allow me to go forward and backward through the cursor locations?
The reason I ask is because I find that by using Command-Double left click, I visit function definitions (often in the same file), and then I want to quickly return to where I was previously in the same file. Because I'm in the same file the file history navigation is not useful. Currently I have to search through the code to figure out where I was, which is tedious.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
在xcode4中,[Control + Command + <--]跳转到上一个,[Control + Command + -->]跳转到下一个。
In xcode4, [Control + Command + <--] jump to the previous, [Control + Command + -->] jump to the next one.
XCode 3.1 中没有。
XCode 3.2 仍处于 NDA 状态,因此我们不能在这里讨论它的功能,但有很多新功能,当它发布时,你绝对应该重新研究这个问题。
Not in XCode 3.1.
XCode 3.2 is still under NDA, so we can't discuss its features here, but there are a lot of new features, and you should definitely reinvestigate the question when it comes out.
是的,确实如此 - Command + Alt + 。
我的 XCode 是 3.1.2,它几乎每次都能工作。 如果您打开一个新窗口并开始在那里工作,它将不会转到您之前的工作窗口。 但是,如果您在单个窗口中编码期间更改文件和/或文件中的位置 - 它会让您恢复正常。
它称为“后退”,与“前进”一起位于“视图”菜单中 - Command + Alt + 。
对于“转到函数定义”,默认键绑定是 Command + F12。 在菜单中,它位于“编辑”->“ 查找-> 跳转到定义
Yes, it does - Command + Alt + .
My XCode is 3.1.2 and it works...almost every time. It you open a new window and start working there it won't go to your previous working window. But if you change files and/or positions in files during your coding in a single window - it'll get you back.
It is called "Go Back" and lives in View menu along with "Go Forward" - Command + Alt + .
For "Go to function definition" the default key binding is Command + F12. In the menu it lives in Edit -> Find -> Jump to Definition
我搜索了很长时间,对我有用的是:
⌃ + 2 (Ctrl + 2 - 显示以前的历史记录)然后单击 ↓ - 这将跳回到以前的定义
⌃ + 3 (Ctrl + 3 - 显示下一个历史记录)然后单击 ↓ - 这将跳转到下一个定义。
只有当您使用 ⌃ + 6 在定义之间跳转来浏览类时,这才会起作用。
I was searching for this for so long time and what works for me is:
⌃ + 2 (Ctrl + 2 - Shows previous history) then click ↓ - this will jump back to previous definition
⌃ + 3 (Ctrl + 3 - Shows next history) then click ↓ - this will jump to next definition
This will only work if you navigate through your class using ⌃ + 6 to jump between definitions.
xcode 3.1.1 中默认没有定义跳转到定义
你可以自己设置。 转到xcode->首选项->键绑定->查找->跳转到定义
jump to definition is not defined by default in xcode 3.1.1
you may set it yourself. go to xcode->preference->key bindings->find->jump to definition