vscode-bookmarks

alefragnaniGPL-3.0活跃维护

VS Code 书签扩展,可在代码任意行打标记并快速跳转,方便在大型项目中来回切换关键位置。

Bookmarks Extension for Visual Studio Code

v13.0.1发布于 2021-02-16 01:00 UTC2,187star +1 / 7 天216fork同步于 2026-11-10 23:45 UTC

怎么上手

由 README 提炼,执行前请确认
在 VS Code 扩展市场搜索 Bookmarks 并安装
硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

VS Code 书签扩展,在代码中标记位置并快速跳转,省去反复搜索

VS Code 书签扩展,可在代码任意行打标记并快速跳转,方便在大型项目中来回切换关键位置。

核心能力

  • 用 Toggle 命令标记/取消标记任意代码位置
  • 支持带标签书签并在行内显示标签文本
  • 在书签间前后跳转,可跨文件导航
  • 侧边栏列出当前文件与整个项目的书签
  • 按书签选择行或区域,便于分析日志

容易踩的坑

书签默认不保存到项目,需设置 bookmarks.saveBookmarksInProject 为 true 才会写入仓库;Prettier 等格式化工具不通知文档变更,可能打乱书签位置,需开启 bookmarks.useWorkaroundForFormatters;bookmarks.keepBookmarksOnLineDelete 不支持 Undo 回退书签位置

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v13.0.1
  1. v13.0.1最新正式版2021-02-16 · 2021-02-16 01:00 UTC

    [13.0.1] - 2021-02-15

    Fixed

    • Command bookmarks.toggle not found - extension was not activated (issue #387)

    [13.0.0] - 2021-02-13

    Added

    • Support Remote Development (issue #230)
    • Improvements on multi-root support (issue #193)
    • Group bookmarks by folder on multi-root in Side Bar (issue #249)
    • Multi-platform support (issue #205)

    Internal

    • Do not show welcome message if installed by Settings Sync (issue #377)
  2. v12.1.32021-01-16 · 2021-01-16 12:51 UTC
    查看更新说明

    Changed

    • Added new translations (Thanks to @loniceras PR #367)

    Internal

    • Update whats-new submodule API (issue #373)
    • Tabnine becomes a Sponsor
  3. v12.1.02020-12-24 · 2020-12-24 20:53 UTC
    查看更新说明

    Added

    • Support submenu for editor commands (issue #351)

    Changed

    • Setting bookmarks.navigateThroughAllFiles is now true by default (issue #102)

    Internal

    • Remove unnecessary files from extension package (issue #355)
  4. v12.0.02020-11-25 · 2020-11-25 00:00 UTC
    查看更新说明

    Added

    • Open Settings command to the Side Bar (issue #352)
    • Toggle Labeled command to the Context Menu (Thanks to @fade2gray PR #342)

    Changed

    • Switch initialization to onStartupFinished API (Thanks to @jasonwilliams PR #343)

    Fixed

    • Clearing bookmark label through Toggle Labeled command leaving leading spaces (issue #344)
    • Leading spaces while using Move Line Up/Down (issue #348)
    • "Ghost" Bookmarks after renaming files (issue #209)

    Internal

    • Use vscode-ext-help-and-feedback package (issue #346)
  5. v11.4.02020-11-08 · 2020-11-08 12:16 UTC
    查看更新说明

    Added

    • Support clear the bookmark label in Toggle Labeled and Edit Label commands (issue #320)

    Changed

    • Localization support - zh-cn (Thanks to @loniceras PR #327)

    Fixed

    • Typo in Side Bar welcome page (Thanks to @osteele PR #316)

    Internal

    • Update CodeStream sponsorship details

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    What's new in Bookmarks 14.1

    • Adds Export support
    • Improved Side Bar
    • Improved Labeled Bookmark
    • Fully Open Source again
    • Adds Persian, French, Hindi and Polish translations
    • Setting to customize overview ruler lane
    • Published to Open VSX

    Support

    Bookmarks is an extension created for Visual Studio Code. If you find it useful, please consider supporting it.

    Bookmarks

    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:

    • Mark/unmark positions in your code
    • Mark positions in your code and give it name
    • Jump forward and backward between bookmarks
    • Icons in gutter and overview ruler
    • See a list of all Bookmarks in one file and project
    • Select lines and regions with bookmarks
    • A dedicated Side Bar

    Features

    Available commands

    • Bookmarks: Toggle Mark/unmark positions with bookmarks
    • Bookmarks: Toggle Labeled Mark labeled bookmarks
    • Bookmarks: Jump to Next Move the cursor forward, to the bookmark below
    • Bookmarks: Jump to Previous Move the cursor backward, to the bookmark above
    • Bookmarks: List List all bookmarks in the current file
    • Bookmarks: List from All Files List all bookmarks from all files
    • Bookmarks: Clear remove all bookmarks in the current file
    • Bookmarks: Clear from All Files remove all bookmarks from all files
    • Bookmarks: Export Export all bookmarks to a Markdown document with customizable format
    • Bookmarks (Selection): Select Lines Select all lines that contains bookmarks
    • Bookmarks (Selection): Expand Selection to Next Expand the selected text to the next bookmark
    • Bookmarks (Selection): Expand Selection to Previous Expand the selected text to the previous bookmark
    • Bookmarks (Selection): Shrink Selection Shrink the select text to the Previous/Next bookmark

    Manage your bookmarks

    Toggle / Toggle Labeled

    You can easily Mark/Unmark bookmarks on any position. You can even define Labels for each bookmark.

    Toggle

    Bookmark labels visible inline

    You can turn on bookmark labels text visibility inline in the same line where labeled bookmark is placed:

    Bookmarks with labels

    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.

    Navigation

    Jump to Next / Previous

    Quicky move between bookmarks backward and forward, even if located outside the active file.

    List / List from All Files

    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.

    List

    • Bookmarks from the active file only shows the line number and its contents
    • Bookmarks from other files in the project also shows the relative path

    Side Bar

    The Bookmarks extension has its own Side Bar, with a variety of commands to improve you productivity.

    Single FolderMulti-root Workspace
    Side BarSide Bar

    Improved Multi-root support

    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.

    List

    Remote Development support

    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.

    Selection

    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 Lines

    Select all bookmarked lines. Specially useful while working with log files.

    Select Lines

    Expand Selection to the Next/Previous Bookmark or Shrink the Selection

    Manipulate the selection of lines between bookmarks, up and down.

    Export

    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:

    FileLineColumnLabelContent
    src/example.ts105Importantfunction calculateTotal() {
    src/utils.ts251TODO// 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 content

    Example custom formats:

    CSV format:

    $file,$line,$column,"$label","$content"
    

    Simple list:

    $file:$line - $label
    

    Available Settings

    • Allow navigation through all files that contains bookmarks (true by default)
        "bookmarks.navigateThroughAllFiles": false
    
    • Allow navigation to wrap around at the first and last bookmarks in scope (current file or all files) (true by default)
        "bookmarks.wrapNavigation": true
    
    • Bookmarks are always saved between sessions, and you can decide if it should be saved in the Project, so you can add it to your Git/SVN repo and have it in all your machines (false by default)
        "bookmarks.saveBookmarksInProject": true
    
    • Path to another image to be shown as Bookmark (16x16 px)
        "bookmarks.gutterIconPath": "c:\\temp\\othericon.png"
    

    Deprecated in 13.3: Use bookmarks.gutterIconFillColor and bookmarks.gutterIconBorderColor instead

    • Specifies the fill color of the bookmark icon
        "bookmarks.gutterIconFillColor"
    
    • Specifies the border color of the bookmark icon
        "bookmarks.gutterIconBorderColor"
    
    • Choose the background color to use on a bookmarked line
        "bookmarks.backgroundLineColor"
    

    Deprecated in 10.7: Use workbench.colorCustomizations instead. More info in Available Colors

    • Enable showing bookmark label text next to actual line with labeled bookmark (false by default)
        "bookmarks.label.inline.enabled": true
    
    • Margin between end of the line and bookmark label inline text. Makes sense only if bookmarks.label.inline.enabled setting enabled (2 by default)
        "bookmarks.label.inline.margin": 2
    
    • Change bookmark label inline text font style. For example: "italic". Makes sense only if bookmarks.label.inline.enabled setting enabled ("normal" by default)
        "bookmarks.label.inline.fontStyle": "normal"
    
    • Font thickness for bookmark label inline text. Makes sense only if bookmarks.label.inline.enabled setting enabled (400 by default)
        "bookmarks.label.inline.fontWeight": 400
    
    • Allow bookmarks commands, (Toggle, Jump to Next/Previous), to be displayed on the editor contex menu (true by default)
        "bookmarks.showCommandsInContextMenu": true
    
    • Experimental. Enables the new Sticky engine with support for Formatters, improved source change detections and undo operations (true by default)
        "bookmarks.experimental.enableNewStickyEngine": false
    
    • "Specifies whether bookmarks on deleted line should be kept on file, moving it down to the next line, instead of deleting it with the line where it was toggled." (false by default)
        "bookmarks.keepBookmarksOnLineDelete": true
    

    Limitation: It does not support Undo operations. It means that, once you delete a line and the bookmark is moved to the next available line, the Undo operation won't move the bookmark back to the previous line. The next line is now the new location of the bookmark.

    • Use a workaround for formatters, like Prettier, which does not notify on document changes and messes Bookmark's Sticky behavior (false by default)
        "bookmarks.useWorkaroundForFormatters": true
    

    This workaround can be turned off if you are using the new Sticky Engine (setting above)

    • Choose if the Side Bar should start expanded (false by default)
        "bookmarks.sideBar.expanded": true
    
    • Controls the count badge on the Bookmark icon on the Activity Bar (all by default)

      • all: Show the sum of bookmarks from all files
      • files: Show the sum of files that contains at least one bookmark
      • off: Disable the Bookmarks count badge
        "bookmarks.sideBar.countBadge": "files"
    
    • Controls the visibility of the Welcome Views in the Side Bar (false by default)
        "bookmarks.sideBar.hideWelcome": true
    
    • Choose 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 bookmark
      • eachLineIndependently: 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 required
      • suggestWhenSelected: 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 editor
      • center: Reveals the bookmarked line in the center of the editor
        "bookmarks.revealLocation": "center"
    
    • Specifies the lane in the overview ruler where the bookmarked line will be shown (full by default)

      • none: Don't show the bookmarked line in the overview ruler
      • left: Show the bookmarked line in the left lane of the overview ruler
      • center: Show the bookmarked line in the center lane of the overview ruler
      • right: Show the bookmarked line in the right lane of the overview ruler
      • full: Show the bookmarked line in the full height of the overview ruler
        "bookmarks.overviewRulerLane": "left"
    
    • Specifies the export pattern for bookmarks. Use variables like $file, $line, $column, $label, and $content to customize the output format (table format by default)
        "bookmarks.export.pattern": "| $file | $line | $column | $label | $content |"
    

    Example patterns:

    CSV format:

        "bookmarks.export.pattern": "$file,$line,$column,\"$label\",\"$content\""
    

    Simple list:

        "bookmarks.export.pattern": "$file:$line - $label"
    

    Available Colors

    • Choose the background color to use on a bookmarked line
        "workbench.colorCustomizations": {
          "bookmarks.lineBackground": "#157EFB22"  
        }
    
    • Choose the border color to use on a bookmarked line
        "workbench.colorCustomizations": {
          "bookmarks.lineBorder": "#FF0000"  
        }
    
    • Choose marker color to use in the overview ruler
        "workbench.colorCustomizations": {
          "bookmarks.overviewRuler": "#157EFB88"  
        }
    
    • Choose text color for bookmark label inline text. Makes sense only if bookmarks.label.inline.enabled setting enabled
        "workbench.colorCustomizations": {
          "bookmarks.labelInlineMessageTextColor": "#23ca11f3",
        }
    
    • Choose background color for bookmark label inline text. Makes sense only if bookmarks.label.inline.enabled setting enabled
        "workbench.colorCustomizations": {
          "bookmarks.labelInlineMessageBackgroundColor": "#6161611a"
       }
    

    Project and Session Based

    The bookmarks are saved per session for the project that you are using. You don't have to worry about closing files in Working Files. When you reopen the file, the bookmarks are restored.

    It also works even if you only preview a file (simple click in TreeView). You can put bookmarks in any file and when you preview it again, the bookmarks will be there.

    License

    GPL-3.0 © Alessandro Fragnani