4. Bookmarks

4.1. Generating several bookmarks at once

In Bluefish you can add bookmarks to a line in the text, and you can later use the bookmark to quickly jump to this location, or even to open the document referred to by the bookmark at that line.

Bookmarks can be added to the current cursor location by using the EditAdd Bookmark (Ctrl-D) menu item; or by right-clicking in the text, and selecting Add bookmark. You can delete a bookmark using the Delete bookmark item in the document contextual menu.

Each bookmark in a given document is marked by a blue background in the line number margin.

A screen shot showing how bookmarks are marked

Figure VI.9. How Bookmarks are marked

Bookmarks can be temporary or permanent. Permanent bookmarks are stored, and temporary bookmarks are gone after Bluefish is closed. The default is set in the preferences under Editor.

Bookmarks can be found in the third tab of the side panel, sorted by document and line number.

A screen shot showing bookmarks in the side panel

Figure VI.10. Bookmarks in the Side Panel

If you right click a bookmark in the bookmark tab of the side panel, you get a pop up menu with several options.

A screen shot showing the contextual menu on bookmark in the side panel

Figure VI.11. Contextual Menu on Bookmark in the Side Panel

The Goto bookmark item allows you to go to the bookmark location in the document, opening it if needed.

The Edit item allows you to change a bookmark from temporary to permanent or the other way around, to name it, and to give it a short description.

A screen shot showing the edition of a bookmark

Figure VI.12. Editing a Bookmark

Note that after naming a bookmark, the default name - first characters of the bookmarked line - is displayed after the new name.

A screen shot showing a named bookmark

Figure VI.13. A named Bookmark

Via this contextual menu, you may also delete a bookmark, delete all bookmarks in the active document, or delete all bookmarks stored in the bookmark tab of the side panel. The latter ones are also available when you right click the name of a document in this tab.

A screen shot showing the contextual menu on a document in the bookmark tab

Figure VI.14. The Contextual Menu on a Document in the Bookmark Tab

4.1. Generating several bookmarks at once

To add many bookmarks at once, use the EditFind (Ctrl-F) dialog. Check the Bookmark result option, and all search results will be added to your bookmarks.

For example, the XML files for this manual have sections, each identified by a header like <sect1 id="nameofthesection">. A way to automatically get a bookmark to every section is to search for the following posix regular expression pattern: <sect[0-9]+ id="[^"]+"> and bookmark all results.

A screen shot showing how to bookmark with Posix regular expression

Figure VI.15. Bookmarking with Posix Regular Expression

Here is the result:

A screen shot showing the bookmarks with Posix regular expression

Figure VI.16. Bookmarks with Posix Regular Expression

Here are two examples which bookmarks all functions in Objective-C and PHP files with POSIX or PERL regular expressions:

A screen shot showing how to bookmark Objective C functions via the Find menu

Figure VI.17. Bookmarking Objective C Functions via the Find Menu

A screen shot showing another use of regular expressions in the find dialog

Figure VI.18. Bookmarking PHP Functions via the Find Menu

Check Section 5.3, “Find and Replace Using Regular Expressions” for more information on finding and replacing with regular expression in Bluefish.