Bookmarks Extension for Visual Studio Code
Bookmarks is an extension created for Visual Studio Code. If you find it useful, please consider supporting it.
It helps you to navigate in your code, moving between important positions easily and quickly. No more need to search for code. It also supports a set of selection commands, which allows you to select bookmarked lines and regions between bookmarked lines. It's really useful for log file analysis.
Here are some of the features that Bookmarks provides:
Bookmarks: Toggle Mark/unmark positions with bookmarksBookmarks: Toggle Labeled Mark labeled bookmarksBookmarks: Jump to Next Move the cursor forward, to the bookmark belowBookmarks: Jump to Previous Move the cursor backward, to the bookmark aboveBookmarks: List List all bookmarks in the current fileBookmarks: List from All Files List all bookmarks from all filesBookmarks: Clear remove all bookmarks in the current fileBookmarks: Clear from All Files remove all bookmarks from all filesBookmarks: Export Export all bookmarks to a Markdown document with customizable formatBookmarks (Selection): Select Lines Select all lines that contains bookmarksBookmarks (Selection): Expand Selection to Next Expand the selected text to the next bookmarkBookmarks (Selection): Expand Selection to Previous Expand the selected text to the previous bookmarkBookmarks (Selection): Shrink Selection Shrink the select text to the Previous/Next bookmarkYou can easily Mark/Unmark bookmarks on any position. You can even define Labels for each bookmark.
You can turn on bookmark labels text visibility inline in the same line where labeled bookmark is placed:
This can help you store notes about code without needing to remove these comments later (because bookmarks are not stored in source code and won't be accidentally committed to version control system).
This feature also helps organize TODOs that you want to keep in memory while writing a pull request.
The appearance of inline bookmark labels can be fine-tuned using various settings provided by extension.
Quicky move between bookmarks backward and forward, even if located outside the active file.
List all bookmarks from the current file/project and easily navigate to any of them. It shows a line preview and temporarily scroll to its position.
The Bookmarks extension has its own Side Bar, with a variety of commands to improve you productivity.
| Single Folder | Multi-root Workspace |
|---|---|
When you work with multi-root workspaces, the extension can manage the bookmarks individually for each folder.
Simply define saveBookmarksInProject as true on your User Settings or in the Workspace Settings, and when you run the Bookmarks: List from All Files command, you will be able to select from which folder the bookmarks will be shown.
The extension now fully supports Remote Development scenarios.
It means that when you connect to a remote location, like a Docker Container, SSH or WSL, the extension will be available, ready to be used.
You don't need to install the extension on the remote anymore.
Better yet, if you use bookmarks.saveBookmarksInProject setting defined as true, the bookmarks saved locally will be available remotely, and you will be able to navigate and update the bookmarks. Just like it was a resource from folder you opened remotely.
You can use Bookmarks to easily select lines or text blocks. Simply toggle bookmarks in any position of interest and use some of the Selection commands available.
Select all bookmarked lines. Specially useful while working with log files.
Manipulate the selection of lines between bookmarks, up and down.
Export all bookmarks to a new Markdown document with a customizable format. This is especially useful for documentation and sharing bookmarks with others.
The default format exports bookmarks as a Markdown table, grouped by file and sorted by line number:
| File | Line | Column | Label | Content |
|---|---|---|---|---|
| src/example.ts | 10 | 5 | Important | function calculateTotal() { |
| src/utils.ts | 25 | 1 | TODO | // TODO: Implement error handling |
You can customize the export format using the bookmarks.export.pattern setting with the following variables:
$file - File path (relative to workspace)$line - Line number$column - Column number$label - Bookmark label$content - Line contentExample custom formats:
CSV format:
$file,$line,$column,"$label","$content"Simple list:
$file:$line - $labeltrue by default) "bookmarks.navigateThroughAllFiles": falsetrue by default) "bookmarks.wrapNavigation": truefalse by default) "bookmarks.saveBookmarksInProject": true "bookmarks.gutterIconPath": "c:\\temp\\othericon.png"Deprecated in 13.3: Use
bookmarks.gutterIconFillColorandbookmarks.gutterIconBorderColorinstead
"bookmarks.gutterIconFillColor" "bookmarks.gutterIconBorderColor" "bookmarks.backgroundLineColor"Deprecated in 10.7: Use
workbench.colorCustomizationsinstead. More info in Available Colors
false by default) "bookmarks.label.inline.enabled": true2 by default) "bookmarks.label.inline.margin": 2"italic". Makes sense only if bookmarks.label.inline.enabled setting enabled ("normal" by default) "bookmarks.label.inline.fontStyle": "normal"400 by default) "bookmarks.label.inline.fontWeight": 400true by default) "bookmarks.showCommandsInContextMenu": truetrue by default) "bookmarks.experimental.enableNewStickyEngine": falsefalse by default) "bookmarks.keepBookmarksOnLineDelete": trueLimitation: It does not support
Undooperations. It means that, once you delete a line and the bookmark is moved to the next available line, theUndooperation won't move the bookmark back to the previous line. The next line is now the new location of the bookmark.
false by default) "bookmarks.useWorkaroundForFormatters": trueThis workaround can be turned off if you are using the new Sticky Engine (setting above)
false by default) "bookmarks.sideBar.expanded": trueControls the count badge on the Bookmark icon on the Activity Bar (all by default)
all: Show the sum of bookmarks from all filesfiles: Show the sum of files that contains at least one bookmarkoff: Disable the Bookmarks count badge "bookmarks.sideBar.countBadge": "files"false by default) "bookmarks.sideBar.hideWelcome": trueChoose how multi cursor handles already bookmarked lines (allLinesAtOnce by default)
allLinesAtOnce: Creates bookmarks in all selected lines at once, if at least one of the lines don't have a bookmarkeachLineIndependently: Literally toggles a bookmark in each line, instead of making all lines equal "bookmarks.multicursor.toggleMode": "eachLineIndependently"Specify when a confirmation message should be displayed before clearing bookmarks (never by default)
never - No confirmation (current behavior)
always - Confirm all clear operations
commandPalette - Confirm only when invoked from Command Palette
sideBar - Confirm only when invoked from Side Bar
"bookmarks.confirmClear": "always"Choose how labels are suggested when creating bookmarks (dontUse by default)
dontUse: Don't use the selection (original behavior)useWhenSelected: Use the selected text (if available) directly, no confirmation requiredsuggestWhenSelected: Suggests the selected text (if available). You still need to confirm.suggestWhenSelectedOrLineWhenNoSelected: Suggests the selected text (if available) or the entire line (when has no selection). You still need to confirm "bookmarks.label.suggestion": "useWhenSelected"Choose the location where the bookmarked line will be revealed (center by default)
top: Reveals the bookmarked line at the top of the editorcenter: Reveals the bookmarked line in the center of the editor "bookmarks.revealLocation": "centerNo open issues yet, or sync has not completed.