Code Monkey home page Code Monkey logo

vscode-bookmarks's Introduction


Bookmarks Logo

What's new in Bookmarks 13.5

  • Published to Open VSX
  • Adds Getting Started / Walkthrough
  • Adds Side Bar badge
  • Adds Toggle bookmark via mouse click
  • Adds Icon customization

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 (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

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

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.

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

  • 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 some bookmarks
    • off: Disable the Bookmarks count badge
    "bookmarks.sideBar.countBadge": "files"
  • 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"
  • 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.revealPosition": "center"

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

Side Bar

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

Single Folder Multi-root Workspace
Side Bar Side Bar

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

vscode-bookmarks's People

Contributors

alefragnani avatar aramikuto avatar axetroy avatar b1mind avatar dependabot[bot] avatar derekpock avatar dotnetcarpenter avatar edgardmessias avatar fade2gray avatar gcastl avatar greyelaina avatar guillerpsanchez avatar huangyxi avatar jasonwilliams avatar josedefreitas avatar ksckaan1 avatar loniceras avatar miqh avatar muellerkyle avatar osteele avatar paperturtle avatar snnsnn avatar tlemo avatar vbfox avatar winitop avatar zioroboco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-bookmarks's Issues

Produce error when the bookmarked file is not open

Steps to reproduce:

  • Open folder
  • Open any file and set bookmark in any line
  • Close editor
  • Press F1 and select Bookmarks: List

VSCode show:

Error "Running the contributed command:'bookmarks.list' failed."

If file editor has opened, then all works.

Version 0.10.8
Commit db71ac615ddf9f33b133ff2536f5d33a77d4774e
Date 2016-02-05T10:00:07.223Z
Shell 0.35.6
Renderer 45.0.2454.85
Node 4.1.1

Cannot jump to bookmark when scrolling with mouse

Not sure if this is an issue or a feature that hasn't been implemented yet...

  1. Set a bookmark
  2. Scroll down/up until bookmark is not in the current window
  3. Try to jump to the bookmark, nothing happens, unless the text cursor is not on the same line as the bookmark

On "List from All Files" clicking outside of list closes active file

When navigating the list by keyboard arrows each file is loaded in "preview" mode until the next bookmarked file is loaded (preview mode transfers to next file, previous file is pinned).

Clicking off the list (click into the file body) closes the preview (of currently selected bookmark in list) and returns the user to the last bookmark of the previous file pinned.

There are two issues really. 1) clicking in the document that is previewed closes the document, 2) previous documents get pinned causing a pile-up of documents to be opened.

Ability to navigate to bookmarks in other files

Hi,

Unless I'm missing something, it appears that executing "Jump to Next" or "Jump to Previous" only includes bookmarks in the same file. In Visual Studio 'full', the feature will include bookmarks across all files. This is extremely useful in large projects.

Do you think that this is this something very difficult to achieve? If you don't, then I'm open to helping.

Kind regards and thanks for the plug-in.

Bookmarks are cleared after closing VS Code

Hi, @alefragnani

I'm not really sure if it is a bug or maybe a feature, but once VS Code is closed I loose all of my bookmarks. It would really be nice to have them saved cross code's sessions.

Keeping this aside, I think this plug-in is a must and should be included in the core of the editor. Nice work!!! Thanks you.

Suggestion: Support more functions on bookmarked/unmarked lines

Nice extension BTW. Are you considering to extend it to include functions like those found in Notepad++?

  • Cut Bookmarked Lines
  • Copy Bookmarked Lines
  • Paste to (Replace) Bookmarked Lines
  • Remove Bookmarked Lines
  • Remove Unmarked Lines - leave only Bookmarked lines
  • Inverse Bookmark
  • Find based Bookmark (find and mark the lines where is found)

Just a suggestion, the extension is great already.

Extremely large files display error "Open a file to toggle bookmarks"

When attempting to use any of the bookmark commands on a very large file (100,000 lines anecdotally) an info popup appears at the top displaying the message: "Open a file first to toggle bookmarks".

My reproduction:

  1. Open large file.
  2. Attempt to toggle breakpoint
  3. Failure message appears.
  4. Create copy of the large file.
  5. Cut the file down to 50 lines.
  6. Save, close, reopen pruned copy.
  7. Can now toggle breakpoints.

Suggestion: Bookmarks to remember column number

Currently bookmarks only use entire lines. When jumping to a bookmark the cursor moves to column 1. This suggestion is to have the bookmark remember the column number where the bookmark was set and return to the column number also.

Preview bookmarked lines

Create a new command (Bookmarks: List) that will show all bookmarked lines, with its content, so you easily identify which bookmark you would want to go.

Add support to bookmark which could stick with method signature

Request feature:

Now the extension works great, but the problem is that it is based on line number, so every time I changed the code, the bookmark should update accordingly in order to match the latest change.

Any improvement could be very thankful. :)

Commands in context menu

As for breakpoints, it would be easier to add / remove bookmarks via the context menu if it's doable. ๐Ÿ˜‹

Bookmarks are not being saved for 'preview' files

If you set bookmarks for files that are only previewed, they are not restored when returning to that file.

Only files that goes to Working Files (double clicked in treeview or modified in preview) are saving the bookmarks.

Bookmarks are _invalidated_ if the file is modified outside VSCode

If you edit the file outside VSCode, no matter if you have the file opened or not, the bookmarks become invalid.

Two problems appears:

  • If the file is shorter than before, the bookmarks from the deleted lines are moved (appears) to the end of the file (last line). But if you try to navigate with next, it is not reached
  • If you try to List bookmarks, and error occurs and the list is not displayed

A fix should be check for unreacheable bookmarks when loading, removing them from the file. This should fix both erros.

An enhancement should be add the line contents to the bookmark data so not only unreacheable bookmarks should be fixed, but also outside moved lines could be detected and even fixed

Suggestion: Select all bookmarked lines

A command for selecting all bookmarked lines in the current file could be useful (for example, when working with log files). For example: Scroll through a log file and bookmark lines of interest. Run command to select all lines that are bookmarked, then copy to clipboard.

"No handler found for the command bookmarks.toggle"

Running VSCode 0.10.1

To reproduce:

  1. install the bookmarks extension
  2. open a file
  3. invoke the ">Bookmarks: Toggle" command in the Command Palette.

Result:
"No handler found for the command booksmarks.toggle"

In the console i see the following message:

TypeError: Cannot read property 'document' of undefined

Use transparent icon

Replace the current bookmark icon for a transparent one, so it will be shown correctly no matter the theme used

List/Clear bookmarks from all files

Based on the review in the marketplace

If the Bookmarks List command can list all the bookmarks in all files, not just the current file, and the Bookmark Clear can clear all the bookmarks in all files, then it will be awesome.

Saving Bookmarks

currently when I close the project and reopen it, bookmarks are gone. is this a bug or I have to save bookmarks somehow that I don't know about

Next or Previous bookmarks not working

Using the next or previous bookmark either via the hot key, or selecting from the list, is not working. It doesn't seem to do anything. I have this same exact problem with another library of yours (project manager). Seems like the same issue.

Problem with polish character

VSCode Version: 1.3.1
OS Version: WIndows 10 (polish language)
Bookmarks: 0.9.0
Steps to Reproduce:

Press key RightAlt-l
Instead of getting polish character "ล" some other operation is done (cursor is going to 1 col)

Sticky bookmark

Would be a nice feature to be able to make the bookmarks sticky to the original line of code when the bookmark was first added. After a while of coding all my bookmarks make no sense anymore.

Toggle Editing Mode

Would it be possible to add the capability to place the opened file into edit mode when a bookmark is added?

To be more clear:

  1. Open a project with multiple files.
  2. Click on a file and add a bookmark without making any other edits. The file will be listed with the file name in italics
  3. Click on another file
  4. The file gets closed (yet the bookmark does persist)

Could we have the option so that the file is placed into edit mode and does not get closed when a bookmark is added?

Sticky Bookmarks fail if file has unstaged changes in git and already bookmarked when opened

To reproduce this issue,

  1. Enable bookmarks.useStickyBookmarks = true (I also have "editor.trimAutoWhitespace": false, but the bug persists with or without it)
  2. Create a file and add it into git so that it's tracked.
  3. Open the file in vscode and change it. Save the changes but don't stage the changes in git.
  4. Add a bookmark on the file.
  5. Close the file and then open it again.
  6. Make a change to the file above the line that's bookmarked. The bookmark moves or fails.

Here's a gif of the bug in action. Note the lines indicating that the file is currently versioned and changed in git.

The bookmark works at first; it only fails after closing the file and reopening it:
vscodebookmarkissue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.