Code navigation for inline bookmarks made easy.
Other extensions allow you to set bookmarks with some clicks in the IDE. With Inline Bookmarks you specify custom trigger words inside your documents that are automatically turned into VSCode Bookmarks. They will show up with a customizable gutter icon next to the code lines and are highlighted within the code. Decorations can be customized. An Inline Bookmarks View in the Explorer Panel helps you keep track of all your bookmarks. Navigating to the bookmark location is as easy as clicking on an item in the view.
The extension can be used to keep track of development notes and todo's, for document review, as well as log analysis and auditing purposes. Since bookmarks are stored with your documents you can easily share your notes and bookmarks with others.
the following bookmark styles are provided by default: red, green, blue, purple
Note: Additional bookmark types with custom colors/decoration styles can be added in the extension settings. See FAQ.
@todo
- (blue) General ToDo remark.@note
- (blue) General remark.@remind
- (blue) General remark.@follow-up
- (blue) General remark.@audit
- (red) General bookmark for potential issues.@audit-info
- (blue) General bookmark for information to be noted for later use.@audit-ok
- (green) Add a note that a specific line is not an issue even though it might look like.@audit-issue
- (purple) Reference a code location an issue was filed for.Note: Words can be fully customized in: code → preferences → Extensions: Inline Bookmarks
.
Note: Keyboard shortcuts can be assigned in: code → preferences → keyboard shortcuts
.
command: inlineBookmarks.showSelectBookmark
inline-bookmarks.view.followMode
.inlineBookmarks.jumpToNext
, inlineBookmarks.jumpToPrevious
(assign your own keyboard shortcut in vscode preferences) inlineBookmarks.setTreeViewFilterWords
.
jumpToNext
, jumpToPrevious
Buttons (left to right):
Scan Workspace for Bookmarks: scans all documents in the workspace for bookmark tags
Optionally, hide items from the bookmarks view that are excluded by a downstream .gitignore
file (inline-bookmarks.view.exclude.gitIgnore
; default: false
; requires reload).
Go to code → preferences → Extensions: Inline Bookmarks
.
Bookmarks are cached in the vscode workspace. In case of permanent "ghost entries" or other errors you might want to try to execute the command: inlineBookmarks.debug.state.reset
. This is going to reset the cache and allow the extension to populate it from scratch. Bookmarks are typically added as you go when opening new files in the editor. You can also make the extension scan the workspace for files containing Bookmarks. We don't do this automatically as it is quite resource intensive.
By default all paths are included (inline-bookmarks.search.includes
) except the ones defined with inline-bookmarks.search.excludes
(supports wildcard path globs).
Additionally, file-extensions configured with inline-bookmarks.exceptions.file.extensions.ignore
will be excluded as well (prefer this over search.excludes
).
See inline-bookmarks.exceptions.words.ignore
(matches the beginning of the word).
The extension will search for all the default trigger-words configured with the extension. Note that these default trigger-words can be overriden (or removed). In addition, we give you complete freedom over any custom trigger-words you would want to configure. See example.
Note
gutterIconColor
may be used to specify a custom icon color using any RGBA format. gutterIconColor will override gutterIconPath. See example below.gutterIconPath
may refer to only the four images provided with the extension right now: images/bookmark-{red,green,blue,purple}.svg
. See example below. Example word mapping: (accepts regular expressions; \
needs to be encoded as \\
)
"inline-bookmarks.expert.custom.words.mapping": {
"blue": ["@audit\\-info[ \\t\\n]"],
"purple": ["@audit\\-issue[ \t\\n]"],
"green": ["@audit\\-ok[ \\t\\n]"],
"red": ["@audit[ \\t\\n]"],
"warn": ["@warn[ \\t\\n]"]
}
Example style definition: (all vscode style properties are allowed)
"inline-bookmarks.expert.custom.styles": {
"default": {
"gutterIconColor": "#157EFB",
"overviewRulerColor": "rgba(21, 126, 251, 0.7)",
"light": {
"fontWeight": "bold"
},
"dark": {
"color": "Chocolate"
}
},
"red": {
"gutterIconColor": "#F44336",
"light": {
"fontWeight": "bold"
},
"dark": {
"color": "Chocolate"
}
},
"blue": {
"gutterIconColor": "#157EFB",
"light": {
"fontWeight": "bold"
},
"dark": {
"color": "Chocolate"
}
},
"green": {
"gutterIconColor": "#2FCE7C",
"light": {
"fontWeight": "bold"
},
"dark": {
"color": "Chocolate"
}
},
"purple": {
"gutterIconColor": "#C679E0",
"light": {
"fontWeight": "bold"
},
"dark": {
"color": "Chocolate"
}
},
"warn": { // example custom style with yellow color
"gutterIconColor": "#F4F400",
"overviewRulerColor": "#F4F400B0",
"light": {
"fontWeight": "bold"
},
"dark": {
"color": "Chocolate"
}
}
}
jumpToNext
and jumpToPrevs
bookmark?See https://code.visualstudio.com/docs/getstarted/keybindings.
inline-bookmarks.view.followMode
allows you to specify if you want to select the nearest
bookmark relative to the current editor selection (default) or the next one (chapter
mode).
jumpToNext
and jumpToPrevs
behavior use the current selected line instead of the last selected bookmark?inline-bookmarks.view.lineMode
can be configured to current-line
. Also see #40.
For performance reasons we do not automatically scan the complete workspace for bookmarks. They are instead added whenever a bookmark is encountered in a file opened in the editor. Bookmarks are then cached in the workspace and revalidated when a file is opened in the editor. In order to allow you to scan the complete workspace for bookmarks we have added a command inlineBookmarks.scanWorkspace
that is also exposed as a button in the bookmark-view. Note that this will temporarily load files matching the search path into the editor to check for bookmarks which may demand some resources.
see CHANGELOG