Does XCode have a cursor navigation stack like Visual Studio?
Asked Answered
H

5

9

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!

Huckleberry answered 24/7, 2009 at 16:58 Comment(0)
R
3

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

Railway answered 18/4, 2011 at 2:36 Comment(0)
M
0

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.

Millham answered 24/7, 2009 at 17:31 Comment(0)
O
0

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

Ossified answered 24/7, 2009 at 17:41 Comment(1)
I just played with this feature (because you mentioned it). For me it works to activate the file level navigation, but it doesn't appear to track my cursor positions within a file. To see this, open a file, and use the pull down menu to visit a few function and click around all with one file. You'll see that the menu options for this are greyed out. Now visit a new file in the same window, it becomes active in the menu.Huckleberry
T
0

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

Tula answered 29/11, 2009 at 11:16 Comment(0)
U
0

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.

Unloosen answered 5/12, 2014 at 12:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.