Vscode-bookmarks: Support Multi Cursor / Selection

Created on 5 Jul 2017  ·  21Comments  ·  Source: alefragnani/vscode-bookmarks

It is possible to select several lines and to bookmark them with on command ?

enhancement multi-cursor sponsor wanted

Most helpful comment

+1 for the use case:
Find pattern,
select all occurrences,
bookmark all !

Thanks !

All 21 comments

Hi @ferengi ,

No, it bookmarks only the _current line_. It does not work for _multi-cursor_, neither for _range_.

Which one are you referring to? _Multi-cursor_ or _range_?

It would be great if you could use it for a range of lines.

How do you think a bookmark for a range of lines should work (to be toggled) and how it would appear in the gutter? Would it present something similar to indentation guides, or just the begin/end images?

Hi @ferengi , do you still need this?

Hi...
yes, that would be helpful-

So, which is your suggestion? Take a look at the comment above...

the easierst way is if you mark several lines and you press "bookmarks.toggle" all line have a bookmark.
Like the same way if make multi comment lines..

I think the same could happen for _multi cursor_. So, a new bookmark would be added/removed for each line that has a cursor.

I will update the description to reflect this

I also want this feature, it would be great to do Ctrl+Shift+L (Select All Ocurrences) Alt+Shif+K (Bookmark Lines with ocurrences of some search)

Just note that "toggle" may not be the best approach, maybe have a "mark", "unmark" feature is better.

Use case 1 (log file):
Mark all lines that contain "Thread-1"
Unmark all lines that contain "DEBUG"
(with the current toggle feature we would have all lines with thread-1 marked except the debug ones, but we would have all the debug lines of the other threads)

Use case 2 (random file):
Mark all lines that contain "alpha"
Mark all lines that contain "beta"
(lines that contain both alpha & beta would be unmarked if the feature was "toggle")

I know that this could be handled with regular expressions, but mark/unmark just seems more productive to me.

edit: I just noticed that #81 exists and asks for something similar

+1 for the use case:
Find pattern,
select all occurrences,
bookmark all !

Thanks !

I am a Textpad user and would love to see a multi-line bookmark that works as follows:

  • Select multiple lines with the mouse, then press Ctrl+Alt+K to toggle the bookmark on all selected lines. If some lines are already bookmarked, un-mark them. Currently, only the last selected line is marked/unmarked.
  • Do the same for lines having multi-cursors. Could be a different command, but I think the behavior would be pretty clear based on what is selected.
  • Copy, Cut, Delete bookmarked lines. You can currently Copy bookmarked lines after Selecting them.
    But three new commands would be nice and a little clearer than 'select', in my opinion. I use these commands all the time in Textpad to move lines between files.

    • Bookmark: Copy lines -- nice to have as just one command

    • Bookmark: Cut lines -- copy them, then delete the lines. Currently Cut leaves annoying blank line(s)

    • Bookmark: Delete lines -- delete the lines without copying them into the clipboard.

  • Don't add a command to bookmark lines based on a search. This already exists. Just do a Find, then press Ctrl+Shift+L to do a multi-cursor select of the lines, and then press Ctrl+Alt+K to bookmark all of selected lines.

These enhancements should be simple enough to do, especially the first two multi-bookmark commands. Great extension. Keep up the good work.

Sue.

That's basically the idea of the feature, simplicity.

Using the _multicursor_ concept, allows me to toggle bookmarks on/off. I won't split in two commands (Toggle On / Toggle Off).

Also, I don't see why to add tree new commands to Copy/Cut/Delete Bookmarked Lines. Simply because you already have a command which selects bookmarked lines (Bookmarks (Selection): Select Lines). You just have to run it and then run Copy/Cut/Delete commands.

Hope this helps

I agree that just changing the behavior of the Toggle On (Ctrl-Alt-K) command is all that's needed. Currently the command bookmarks the last mouse selected line and the current multi-cursor line.

And I agree that three new commands for Copy/Cut/Delete Bookmarked Lines don't add much.

Are you working on the bookmark-multicursor feature?

Thanks. I'm glad you liked.

No, I'm not working on this right now. In fact, this is not on my top priority

First, I would like to sync and share base code between this and my other bookmark extension (Numbered Bookmarks). Then, I would like to refactor how bookmarks are stored, to allow #36 and #76.

This is how I'm planning to prioritize, unless something different appears in the meantime.

Hope this helps

As reported in #164, the multicursor should also update the _sticky_ bookmarks.

Do you have plans to add this previously mentioned multi-line support/feature to bookmarks? It would be really helpful. Thank you!

Yes, I do 😁 .

In fact this is _my favorite_ open enhancement, but it requires a bit reengineering efforts to be properly added. Since I didn't have enough free time (or support) in the last couple of months, it is still _on hold_.

I hope I could find some free time in the next couple of weeks, to focus on some of my extensions, but I'm still not sure _which one_.

Hope this helps

+1 after switching from Sublime Text 3 to VS Code this is one of the most missed features ¯_(ツ)_/¯

I couldn't wait and I had to write my own very basic extension =)
In case someone as me really misses this one feature.
https://marketplace.visualstudio.com/items?itemName=RK.bookmarksng

Hi @chestozo ,

No problem. Congratulations for your extension, it’s really handy 👏

It’s no coincidence, but I started working on this feature two weeks ago. My original idea was to release it before April, but with the current lockdown at home, I didn’t have enough free time to fine tune the solution.

At first, I’ll only support _toggling_ bookmarks, but not _selecting_ or _editing_. What does it means?

  • You will be able to _toggle_ bookmarks with multi cursor
  • You will not be able to _select to bookmark_ with multi cursor
  • You will not have multiple bookmarks moving up/down when you edit the text with multi cursor

Stay tuned

Was this page helpful?
0 / 5 - 0 ratings