Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jump-To-Code-Line Eclipse Shortcuts

is it possible, in Eclipse, to mark certain lines with Shortcuts and be able to quickly jump to those lines?

Example: Let's say I have maintenanceHeavyMethod() at line 120 in my class, gameLoop() at line 800 and some listener at line 1460.

I'd like to f.ex. press CTRL+SHIFT+1, 2, 3 etc. to mark those positions, and then use f.ex. CTRL+1, 2, 3 to immediately jump to them. I don't like split-screens etc, but I need to jump around when writing.

Is there such a feature?

I'm using latest Eclipse to write Java-programs.

like image 245
user314717 Avatar asked Apr 17 '10 14:04

user314717


1 Answers

You can add Bookmarks in your code. Select the code fragment you want to bookmark and then go to Edit > Add Bookmark... (also possible via the menu available with a right-click in the left hand column of the editor, like breakpoints).

Then, add the Bookmarks view. Select Window > Show View > Other... > Bookmarks and you'll get something like this:

alt text

Sadly, I don't think you can bind a shortcut to a particular bookmark.

Just in case, the shortcut to jump to a particular line is CTRL+L.

like image 53
Pascal Thivent Avatar answered Sep 28 '22 10:09

Pascal Thivent