Does XCode have a cursor navigation stack like Visual Studio?

放肆的年华 提交于 2020-01-03 07:58:18

问题


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!


回答1:


In xcode4, [Control + Command + <--] jump to the previous, [Control + Command + -->] jump to the next one.




回答2:


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.




回答3:


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




回答4:


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




回答5:


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.



来源:https://stackoverflow.com/questions/1178892/does-xcode-have-a-cursor-navigation-stack-like-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!