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

后端 未结 7 1055
谎友^
谎友^ 2021-02-02 05:53

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

Say, Ctrl+Shift+1 = Set 1 bookmark

Ctrl+1 =

相关标签:
7条回答
  • 2021-02-02 06:32

    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.

    Eclipse bookmarks tab

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

    0 讨论(0)
  • 2021-02-02 06:35

    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.
    0 讨论(0)
  • 2021-02-02 06:36

    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)

    http://img84.i_mageshack.us/img84/6631/eclipsebookmark.png

    0 讨论(0)
  • 2021-02-02 06:39

    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

    0 讨论(0)
  • 2021-02-02 06:45

    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

    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:

    annot toolbar

    image source: tutorial by vogella

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

    Bookmarks

    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.

    0 讨论(0)
  • 2021-02-02 06:47

    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 讨论(0)
提交回复
热议问题