开发者

Bookmarks in Eclipse, set and go using hotkeys, do they exist?

Bookmarks in Eclipse, set and go using hotkeys, do they exist?

Say, Ctrl+Shift+1 = Set 1 bookmark

Ctrl+1 = go to the place first bookmark wa开发者_开发百科s set


Yes. You need to set a shortcut key for Add Bookmark. Go to Window > Preferences > General > Keys and enter the text filter "bookmark". Add bookmark will be listed, select it. Now bind a new shortcut in Binding. Make sure that there are no conflicts.

Bookmarks in Eclipse, set and go using hotkeys, do they exist?

It may be also a good idea to assign a shortcut to "Show View (Bookmarks)" where all your bookmarks are listed. Alternatively this can be enabled via Window > Show view > Other (shortcut Alt+Shift+Q, Q) > and filter to "bookmark".

From here on, you can set new bookmarks. Eclipse will want you to name your bookmarks.

You can navigate these bookmarks, using "Next Annotation" Ctrl+. and "Previous Annotation" Ctrl+, but you need to enable jumping to bookmarks first via the dropdown of these two in the annotations toolbar:

Bookmarks in Eclipse, set and go using hotkeys, do they exist?

image source: tutorial by vogella

So select any of the two dropdown and enable "Bookmarks":

Bookmarks in Eclipse, set and go using hotkeys, do they exist?

If you don't want other annotations such as Errors and Warnings to be included in the navigation, disable them in the toolbar dropdown for next/previous annotation.

The shortcut for Next/Previous Annotation can also be changed in the Preferences. Their category is Navigate, when: In Windows, you can filter to their names: Next and Previous.


I was not really satisfy with what Eclipse has to offer. But I found a plugin called Quick Bookmarks. See Quick Bookmarks. I love it! I can assign a shortcut to a specif bookmark. Just what I needed. It works with every text file.


Not exactly.

You can only assign a shortcut to add a new bookmark (like I did in the picture below).
But you can go to the bookmark you have just defined only through the "Bookmarks" View (the second shortcut would only display the Bookmark view)

Bookmarks in Eclipse, set and go using hotkeys, do they exist?


I personally like these settings:

  1. Go to Window > Preferences > General > Keys
  2. Type "bookmark" as the filter and select "Add Bookmark"
  3. Click in the box related to binding at the bottom.
  4. Erase previously assigned hotkeys with delete or backspace Then hit Ctrl + Shift + A
  5. Similarly select "Go to next bookmark" and assign Ctrl + B to it.
  6. Finally, select "Toggle Bookmark" at the bottom, and assign Ctrl + Shift + B to it.

This way you can:

  • hit Ctrl + Shift + A to add a bookmark with name (which is shown if you open the Bookmarks view with the name you entered and you can double click on it to go to that line).
  • hit Ctrl + Shift + B to add a bookmark without name (which is also shown in the Bookmarks view but named as "Quick bookmark").
  • hit Ctrl + B to switch between bookmarks and is very handy if you have a few number of bookmarks.


I don't think so. You can assign a shortcut to make bookmarks, but I don't think you can specify a hotkey for each individual bookmark you create.

In Eclipse 3.5, if you go to Windows > Preferences > General > Keys you'll find the Add Bookmark command. Add a hotkey in that dialog.

Then go to Window > Show View > Other... > Bookmarks to display the bookmarks tab.

Bookmarks in Eclipse, set and go using hotkeys, do they exist?

As you would probably expect, double-clicking the entries in the bookmarks tab takes you to the bookmarked line of code.


In Eclipse 3.5 there are some bookmarks related actions cthat can be linked to key shortcuts: to bind them you have to go to menu Window > Preferences > General > Keys and use the word "bookmark" as filter.

Saluti


Additional info: I've got Eclipse Kepler (v4.3) and as mentioned earlier, I've seen a few more bookmark commands available. Of particular interest is the "Next Bookmark" command, which is worth binding a keyboard shortcut to. This will work similar to the "Next Annotation" command, except only jumps to the bookmarks.

Warning: I've noticed that if you edit a file outside of eclipse and then return back to eclipse, you will have lost all your bookmarks, not nice.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜