Jump-To-Code-Line Eclipse Shortcuts

10,323

Solution 1

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.

Solution 2

That would be best taken care by mylyn:

Define a task with this three method, and you will be to see only those 3 in the package explorer view

http://www.tasktop.com/sites/default/files/images/part1-overview.jpg

Solution 3

To jump to a particular method, I use ctrl+o and then start typing the method. If you're a proficient typist, this shouldn't take any longer; keep in mind that you only have to start typing the name of the method.

Unfortunately this isn't a proper solution for jumping to a line of code within a method.

Share:
10,323
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    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.

  • matbrgz
    matbrgz about 14 years
    WHat is your experience using Mylyn on a day to day basis?
  • VonC
    VonC about 14 years
    @Thorbjørn: it requires discipline to manage your tasks, but if they are well-defined and tight enough, it is very effective.
  • VonC
    VonC about 14 years
    Bookmark!... The obvious solution that somehow I didn't thought about when writing my own answer ;) +1
  • Devanshu Mevada
    Devanshu Mevada about 14 years
    @VonC Bookmarks are not an hidden feature but they are not frequently used to my experience. Maybe because they are missing assignable shortcuts :)
  • Admin
    Admin about 14 years
    Yes, that works very well. I guess I could've found that by clicking around more. Even though it's not shortcuts, it does what I need. Thank you!
  • Muthu Ganapathy Nathan
    Muthu Ganapathy Nathan almost 10 years
    If you dont know the exact name, but only a part of the name, start by *name*, where * represents any thing before and after name.
  • Pacerier
    Pacerier over 9 years
    @VonC, Your screen doesn't look like there's any space left allocated to code.....
  • Pacerier
    Pacerier over 9 years
    Ctrl Shift T is also useful.
  • VonC
    VonC over 9 years
    @Pacerier sure, it was one of the screenshots illustrating mylyn features, so they (the features) are displayed here to the exclusion of anything else. But obviously you can reorganize those views in any way you want, and make room for the code.