tintinweb / vscode-inline-bookmarks

Customizable inline Bookmarks for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=tintinweb.vscode-inline-bookmarks
GNU General Public License v3.0
45 stars 14 forks source link

get in touch with Consensys Diligence
[ 🌐 📩 🔥 ]

Inline Bookmarks

inline_bookmarks_icon

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.

Tour

inline_bookmarks_icon

vscode-inline-bookmarks-2

Customizable Inline Bookmarks

Note: Additional bookmark types with custom colors/decoration styles can be added in the extension settings. See FAQ.

Note: Words can be fully customized in: code → preferences → Extensions: Inline Bookmarks. Note: Keyboard shortcuts can be assigned in: code → preferences → keyboard shortcuts.

inline_bookmarks_icon

Filterable Bookmarks Finder

command: inlineBookmarks.showSelectBookmark

inline_bookmarks_icon

Bookmarks View

Buttons (left to right):

Optionally, hide items from the bookmarks view that are excluded by a downstream .gitignore file (inline-bookmarks.view.exclude.gitIgnore; default: false; requires reload).

image

FAQ

Q: Where do I find more settings?

Go to code → preferences → Extensions: Inline Bookmarks.

Q: How can I reset the extensions bookmark cache in case of permanent errors?

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.

Q: How can I control which paths/file-extensions are being processed by the extension?

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).

Q: How do I temporarily exempt certain trigger-words from being decorated?

See inline-bookmarks.exceptions.words.ignore (matches the beginning of the word).

Q: How can I define custom bookmark trigger-words/labels and colors?

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

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"
        }
    }
}

Q: How can I bind keys to jumpToNext and jumpToPrevs bookmark?

See https://code.visualstudio.com/docs/getstarted/keybindings.

Q: How can I change the bookmark-view's follow mode?

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).

Q: How can I make the bookmark-view's 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.

Q: How can I scan the workspace for bookmarks?

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.

Release Notes

see CHANGELOG