Bookmarks
Bookmarks are used to save the current edit location, so you can quickly return to it later. There are two
types of bookmarks:
• Named Bookmarks - Used to mark long-term, meaningful locations in the code, or to quickly set a tem-
porary, named bookmark on the current line.
• Pushed Bookmarks - Used to set temporary "breadcrumbs" as you explore the code.
Named Bookmarks
There are various ways to use named bookmarks:
• Give them a specific name - This is the best way to mark long-term, meaningful locations in the code.
For example, you could set a bookmark named "main" to save the location of the main function.
• Allow automatic naming - This is the quickest way to set temporary, named bookmarks if you don’t
care to spend the time naming them yourself.
• Use a key binding shortcut for the name - Bookmarks can be named according to a specific key
binding. For example, you could bind Ctrl+1 so that it instantly sets a bookmark named "1".
Bookmarks can be set through a variety of methods, depending on which way you want to use them. A
green Bookmark bitmap, displayed in the left margin of the editor window, indicates a set bookmark.
Naming Bookmarks
To set a bookmark on the current line and give it a name, click Search → Set Bookmark (set_bookmark
command). The Bookmarks dialog is displayed. Type the name of the bookmark in the combo box, then
click Add.
Command Line Shortcut - sb
Power programmers may prefer to use the sb command, which is a shortcut for set_bookmark. You can
append sb or set_bookmark with any character or text string, and the bookmark will be instantly set us-
ing the value for the name. For example, sb 1 will allow you to create an instant bookmark named "1",
and sb main will let you create an instant bookmark named "main". See also Command Line Shortcut -
gb.
Allowing Automatic Naming
If you want to quickly set a named bookmark, and you would prefer the editor to automatically name them
for you, press Ctrl+Shift+J, or click Search → Toggle Bookmark (toggle_bookmark command). This
command also instantly toggles the new named bookmark on/off.
When a bookmark is set in this manner, the name is automatically generated and appears in the Eclipse
Bookmarks view in one of two formats: SymbolName:LineNumber, or FileName:LineNumber. The symbol
Named Bookmarks
172