Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save bookmarks as global #287

Open
apj68 opened this issue Apr 15, 2020 · 11 comments
Open

Save bookmarks as global #287

apj68 opened this issue Apr 15, 2020 · 11 comments
Labels
enhancement reengineering Needs high engineering efforts

Comments

@apj68
Copy link

apj68 commented Apr 15, 2020

This is an enhancement request to add an option to save all bookmarks in a single, global location (such as adjacent to settings.json). I realize the design currently is to intentionally limit bookmarks to per-file or per-session, however, I suggest that a third option that makes sense would be to allow the users to save all bookmarks from all files and sessions in a single, global bookmark file. I describe my personal rationale for this a bit in the comments of issue 256 but I think many people would find this a valuable option.

Thanks for the great extension! I'm still just trying to adapt my work processes to live without global bookmarks 😄.

@alefragnani
Copy link
Owner

Hi @apj68 ,

I don't remember seeing similar request before, but I understand the idea.

I wonder how you identify the reason/objective for specific bookmarks, when you open a file from different contexts. I mean, let's say you toggle a bookmark at line 10 in file fileA.json located in projectA, which is the main project inside workspaceA. You added that bookmark to quickly go back to that file/line because it contains a URL used for that project/workspace. Then you open workspaceB which also contains projectA, but as a side project. Then the bookmark at line 10 in fileA.json has no meaning for workspaceB.

But of course, I see people going YES and NO to see that bookmark. To me, in most cases, I would say No, but it's just an opinion.

I have used Delphi for a long time, and it stores the bookmarks on its project file (similar to .csproj), even when I open external files, so I'm used to have bookmarks per session. And when I developed both extensions, I used the same approach.

In the end, I would say it's doable, but when/how, it will depend on feedback/upvotes from other users.

Thanks for your suggestion

@alefragnani alefragnani added enhancement reengineering Needs high engineering efforts labels Apr 15, 2020
@alefragnani
Copy link
Owner

Just a complement to your comment/idea in #256, I wouldn't make bookmarks for files/folders. It would stay as location in files

@apj68
Copy link
Author

apj68 commented Apr 15, 2020

Thanks for your response! Regarding duplicate bookmarks, ideally this would be configurable similar to multi-root so that folks that are accustomed to the per-session or per-file bookmarks can continue to use it as they do. For handling duplicate bookmarks you could do it similar to how vscode handles duplicate filenames in tabs: add the filename automatically to the bookmark so that it appears with the filename in any bookmark lists. For me, I use labels almost exclusively so it's not as much an issue but I see your point.

@alefragnani
Copy link
Owner

I wasn’t saying duplicate bookmakrs, but just a thought on scenarios where you add a bookmark in file fileA.json with one meaning for some project/workspace, could have a different meaning when you open the same fileA.json file, using another project/workspace.

If you define Global bookmarks, no matter how/when/where you open fileA.json it would share/concat all bookmarks added to it, whenever you open the file. And yes, it would definitely be defined in settings.

I see at least one possible limitation (limited/no support for Remotes, like Containers, SSH, WSL, Visual Studio Online). The extension still doesn’t support remotes, but based on what I’ve learned, it could be an issue.

@apj68
Copy link
Author

apj68 commented Apr 16, 2020

AH, I see what you mean. In your example, you could have a bookmark for a project such as project-url which is only relevant in a particular project. I gotcha but I guess for me I don't use bookmarks that way (though I can certainly see how one would want to do that). The way I'd like to use the bookmarks is to make vscode more of a "command central" which is the way I use emacs. For example, in my migration to vs code what I'm finding difficult is that none of the windows "know" about each other. With emacs even if I start additional buffers from the command line I can still hop around those other buffers from any open window. Global bookmarks could enable some semblance of that by being able to persist locations across multiple (concurrent) sessions.

@alefragnani
Copy link
Owner

Exactly 👍

Yes, none of the VS Code windows knows about each other (just the Switch Window... command does), and I miss that myself sometimes.

You could try to use Workspaces, which are just multi-folder windows. It’s not the same thing, but at least you can have more than one project accessible, sharing the same window.

@apj68
Copy link
Author

apj68 commented Apr 20, 2020

👍 Thanks for listening, @alefragnani ! 😄

@ianomad
Copy link

ianomad commented Jul 21, 2021

Totally agree with @alefragnani and vote for global option similarly to settings.json!

I don't ever have workspaces saved and each time pull up an on-demand machine. We have a mono-repo, this means my bookmarks may be very irrelevant for other folks, so it wouldn't make sense to use the option to check-in the bookmarks file into the repo. I would very much prefer to have a local bookmarks file and even better just specify some custom location for it in the local settings.json.

@tarekahf
Copy link

tarekahf commented Nov 24, 2021

This is a required feature. Please implement.
I simply need a feature to enable me to keep bookmarks saved and move them to another project/folder which is cloned on another machine. Also, allow accessing the bookmarks of the child folder if you open the parent folder.

@alefragnani
Copy link
Owner

Hi @tarekahf ,

As I said in Discussions, these are two different things. This feature request is related to Global bookmarks, and these global bookmarks will be stored in VS Code internals, on a per file approach.

But, if you need move bookmarks with the repo to another computer, you should use bookmarks.saveBookmarksInProject setting. The point is, this setting will save bookmarks for each folder only.

The Global bookmarks are not planned to support move to other computer. Mostly because Settings Sync doesn't supports, yet, syncing extensions data. And also, it wouldn't work on a cross platform scenario (path differs from Windows to Linux/MacOS).

@huehnerlady
Copy link

It would be cool to be able to toggle the bookmark 'type' to be either global or local. that way you can have all different settings. There could be another command "Toggle global bookmark" and then you can decide per bookmark if it is just for this project, or if it is globally relevant 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement reengineering Needs high engineering efforts
Projects
None yet
Development

No branches or pull requests

5 participants