How to navigate to the last cursor position in Eclipse?

EclipseKeyboard Shortcuts

Eclipse Problem Overview


Recently, I switched from Visual Studio to Eclipse. Now I am missing the shortcut for navigating to the last cursor position in Eclipse. In Visual Studio, the same can be done with the help of the Ctrl + - shortcut.

How do I do this in Eclipse?

Eclipse Solutions


Solution 1 - Eclipse

Go to Preferences / General / Keys. You'll be able to see or edit the bindings for:

  • Backward History: default is Alt
  • Forward History: default is Alt

You may also use those shortcuts (and see the key bindings) in the toolbar:

Enter image description here

Solution 2 - Eclipse

There is Altleft arrow and Altright arrow to navigate to previous/next cursor positions, and CtrlQ to go to the last edited position.

Solution 3 - Eclipse

I'm adding an answer, because I'm not allowed to comment yet. Though the dystroy's answer contains information about useful shortcuts, I'm not satisfied with it, because the mentioned Alt+left shortcut doesn't always navigate to the last cursor position (e.g. in the same file). I'm not sure how it works in Visual Studio, but in IntelliJ a similar shortcut always moved the cursor to the last cursor position, even in the same file. I would like to have such functionality also in Eclipse. For example: I move the cursor using the keyboard's down arrow key successively on lines 10, 20, 30. Now I am on line 30 and when I press Alt+left I would like the cursor to go to the line 20. After pressing Alt+left again I would like the cursor to go to line 10.

In Eclipse, when the cursor was in file A and I opened file B and moved the cursor down a few lines in file B, then Alt+left will move the cursor to the file A, instead of moving it to a previous cursor position in file B.

I created a separate question for this problem: <https://stackoverflow.com/questions/21483329/how-to-navigate-to-the-last-cursor-position-in-eclipse-if-it-is-in-the-same-file>

Solution 4 - Eclipse

In Mac (OSX), the commands are ⌘[ and ⌘]. They are very convenient navigation commands when coding.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJainendraView Question on Stackoverflow
Solution 1 - EclipseDenys SéguretView Answer on Stackoverflow
Solution 2 - EclipseBaldrickView Answer on Stackoverflow
Solution 3 - EclipsekrmView Answer on Stackoverflow
Solution 4 - EclipseJerryPView Answer on Stackoverflow