Skip to content

alefragnani/vscode-numbered-bookmarks

Repository files navigation


Numbered Bookmarks Logo

What's new in Numbered Bookmarks 8.5

  • Published to Open VSX
  • Adds Getting Started / Walkthrough
  • Adds Rename file support
  • New Sticky Engine

Support

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

Numbered Bookmarks

It helps you to navigate in your code, moving between important positions easily and quickly. No more need to search for code. All of this in in Delphi style.

Features

Available commands

  • Numbered Bookmarks: Toggle Bookmark '#number' Mark/unmark the current position with a numbered bookmark
  • Numbered Bookmarks: Jump to Bookmark '#number' Move the cursor to the numbered bookmark
  • Numbered Bookmarks: List List all bookmarks from the current file
  • Numbered Bookmarks: List from All Files List all bookmarks from the all files
  • Numbered Bookmarks: Clear remove all bookmarks from the current file
  • Numbered Bookmarks: Clear from All Files remove all bookmarks from the all files

Both Toggle Bookmark and Jump to Bookmark commands are numbered from 0 to 9

The Numbered Bookmark 0 has been reactivated in PR #16, but because of this issue it has no keyboard shortcut defined. If sometime in the future these OS related limitation disappears, the shortcuts will be restored.

MacOS users should be aware that some commands shortcuts should conflict with native shortcuts, and uses Cmd instead of Ctrl (Cmd + Shift + 3 and Cmd + Shift + 4)

Manage your bookmarks

Toggle Bookmark '#number'

You can easily Mark/Unmark bookmarks on any position.

Toggle

The default shortcuts are numbered from 0 to 9: Toggle Bookmark # (Ctrl + Shift + #)

Navigation

Jump to Bookmark '#number'

The default shortcuts are numbered from 0 to 9: Jump to Bookmark # (Ctrl + #)

List

List all bookmarks from the current file and easily navigate to any one. It shows you the line contents and temporarily scroll to that position.

List from All Files

List all bookmarks from all files and easily navigate to any one. It shows you the line contents and temporarily scroll to that position.

List

  • Bookmarks from the active file shows the line content and the position
  • Bookmarks from other files also shows the relative file path

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 Numbered 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 numberedBookmarks.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.

Available Settings

  • 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). Set to true and it will save the bookmarks in .vscode\numbered-bookmarks.json file.
    "numberedBookmarks.saveBookmarksInProject": true
  • Controls whether to show a warning when a bookmark is not defined (false by default)
    "numberedBookmarks.showBookmarkNotDefinedWarning": true
  • Per User Requests it is now possible to choose how Bookmarks Navigate Through All Files:
    "numberedBookmarks.navigateThroughAllFiles"

Possible Values:

Value Explanation
false default - same behavior as today
replace you can't have the same numbered bookmark in different files
allowDuplicates you can have the same numbered bookmark in different files, and if you jump repeatedly to the same number, it will look on other files
  • Experimental. Enables the new Sticky engine with support for Formatters, improved source change detections and undo operations (true by default)
    "numberedBookmarks.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)
    "numberedBookmarks.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.

  • Choose the gutter icon fill color
    "numberedBookmarks.gutterIconFillColor"
  • Choose the gutter icon number color
    "numberedBookmarks.gutterIconNumberColor"
  • 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
    "numberedBookmarks.revealPosition": "center"

Available Colors

  • Choose the background color to use on a bookmarked line
    "workbench.colorCustomizations": {
      "numberedBookmarks.lineBackground": "#157EFB22"  
    }
  • Choose the border color to use on a bookmarked line
    "workbench.colorCustomizations": {
      "numberedBookmarks.lineBorder": "#FF0000"  
    }
  • Choose marker color to use in the overview ruler
    "workbench.colorCustomizations": {
      "numberedBookmarks.overviewRuler": "#157EFB88"  
    }

For any of the Color settings, you can use color names blue, RGB rgb(0, 255, 37), RGBA rgba(0, 255, 37, 0.2) or HEX #00ff25 format.

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