Bookmarks plugin¶
Mark lines of interest and jump between them — across every open tab and the files you bookmarked earlier. Bookmarks are shown as a blue dot in the bookmark margin to the left of the text, so flagged lines are visible at a glance.
Where to find it¶
The Search menu:
| Command | Shortcut | What it does |
|---|---|---|
| Toggle Bookmark | Ctrl+F2 |
Adds or removes a bookmark on the caret's line. |
| Next Bookmark | F2 |
Jumps to the next bookmark — in this document, then in the other open tabs, then in the remembered files that are closed. |
| Previous Bookmark | Shift+F2 |
The same walk in the other direction. |
| Clear Bookmarks in Document | — | Removes every bookmark of the active document, after asking. |
| Clear All Bookmarks | — | Removes every bookmark in all files — open tabs and remembered closed files — after asking. |
You can also click in the bookmark margin next to a line to toggle its bookmark.
Next and Previous Bookmark¶
Next Bookmark walks one ring over every bookmark the editor knows:
- the rest of the current document, from the caret down;
- the other open tabs, in the order of the tabs (panes from left to right, each pane's tabs in order) — a document shown in two panes counts once;
- the remembered files that are closed, in the order of their paths;
- then round again from the first open tab.
When the next bookmark is in a closed file, the file is opened on that line; its tab is added at the end of the tab bar. Previous Bookmark walks the same ring backwards. With bookmarks in the current document only, both simply move between its lines and wrap around, as before. The status bar says No bookmarks set. when there is no bookmark anywhere.
Bookmarks are remembered¶
Closing a tab does not lose its bookmarks, and neither does quitting: the next time you open the file, its bookmarks are back — also after a restart.
- Bookmarks are remembered per workspace folder. With a folder open (see Workspace), the bookmarks you set belong to that folder — even in a file outside it; opening another folder shows that folder's bookmarks. Without a folder open, bookmarks go to a store of their own.
- Only files with a path are remembered. A new, never-saved document keeps its bookmarks only while its tab is open.
- Removing the last bookmark of a file forgets the file.
- Bookmarks stay on their lines when the whole text of a document is replaced: reloading a file that changed on disk, Format Document, or unsaved changes restored at start-up. Bookmarks on lines that no longer exist are dropped.
- The store is updated as you go — when you toggle a bookmark, save, close or quit — so even after a crash the bookmarks are those you last saw.
Files that are gone¶
When the walk reaches a remembered file that cannot be opened:
- If its folder is still there but the file is not (it was deleted or renamed), the file's bookmarks are forgotten and the walk goes on to the next bookmark in the same keystroke.
- If the folder itself is not reachable (an unmounted drive, a network share that is offline, a project folder you moved away) or the file cannot be read right now, the file is skipped this time and its bookmarks are kept: they come back when the file does.
No dialog is shown in either case.
Clearing bookmarks¶
Both clear commands ask before they remove anything — it cannot be undone. No leaves everything as it was; when there is nothing to clear, nothing is asked.
- Clear Bookmarks in Document removes the bookmarks of the active document, and forgets them for that file.
- Clear All Bookmarks removes the bookmarks of every open tab and forgets every remembered file of the current workspace folder. Other folders' bookmarks are not touched. It works even when the active tab is not a document.
To get rid of the bookmarks of one closed file only, open it (Next Bookmark does that when it reaches the file) and use Clear Bookmarks in Document.