3

I'm after a feature in eclipse that allows me to allocate a shortcut to a line (say line number 55) then go somewhere else in the same file and hit the shortcut then IDE shows me the line 55. I have used this feature in Delphi IDE. Using CNTL + number keys[1,2,...,0] a shortcut to line where the curser is will be created. This shortcut only has effect within the editor and each opened file would have its own shortcuts. Is there such a feature in eclipse? Is there any plugins out there which adds this feature to eclipse?

Regards,

Ali

mjn
  • 36,362
  • 28
  • 176
  • 378
Ali
  • 899
  • 2
  • 13
  • 33
  • To my knowledge there is no similar feature in Eclipse. The closest I've gotten is to assign the keyboard shortcut Ctrl+K in Eclipse to "Add Bookmark", and Ctrl+Q to "Go to Bookmark". It kind of works, but it's more cumbersome than the Delphi way. – bjaastad_e Jun 01 '12 at 08:17

2 Answers2

6

By default there is no shortcut defined for this task. I use to define my shortcuts in Eclipse in "Windows/Preferences/General/Keys" type bookmark in the filter text and select the commands you want to define the shortcuts.

My current shortcuts are:

  1. Alt+Shift+B, Alt+Shift+A: Add Bookmark;
  2. Alt+Shift+B, Alt+Shift+V: Show View (BookMarks);

But, I agree, still is not fast as the Delphi predefined shortcuts.

Update 1: This plugin (or its sucessor) seems to offer the option. From their site:

  • Add a numbered bookmark at the cursor: Alt>+[digit]. This creates a quick bookmark with the specified number using a "single" keypress. Only one bookmark of the given number can be present in the workspace. Setting the same number bookmark again will clear the earlier instance.

  • Goto a numbered bookmark: Alt+Shift+[digit]. Moves to the bookmark as it was set using Alt+[digit].

Update 2: Tested (Eclipse Indigo) and it worked like a charm.

Ken White
  • 123,280
  • 14
  • 225
  • 444
jfoliveira
  • 2,138
  • 14
  • 25
2

You can add Bookmarks to the code fragments you think are important to you in eclipse.

I referred this link for the same purpose.

Shashank Kadne
  • 7,993
  • 6
  • 41
  • 54