crusj / bookmarks.nvim

Remember file locations and sort by time and frequency and support telescope.
MIT License
222 stars 17 forks source link

Feature: Support categorizing bookmarks into different workspaces #27

Closed PeiweiHu closed 1 year ago

PeiweiHu commented 1 year ago

Thanks for your excellent work which eases my work a lot.

After using it for a while, I have a small suggestion. It would be cool if the plugin supports grouping bookmarks into different workspaces. Currently, all bookmarks, even those belonging to different projects, will be presented together.

One possible solution may be to add a new switchable tab showing the name of the current workspace in the leftmost column.

crusj commented 1 year ago

What does current workspace mean? The current situation is that bookmarks are stored or displayed based on the directory where you are executing nvim.

PeiweiHu commented 1 year ago

Sorry for the late response and thanks for your feedback.

Aw, that's why all bookmarks, even those belonging to different projects, will be presented together. I think I opened neovim in the root directory of different projects.

However, the current implementation has several drawbacks, i.e., bookmarks are stored or displayed based on the directory where you are executing nvim.

I use workspace to express the group/class of bookmarks in logic. For example, there is a workspace bookmark-1 to store all bookmarks marked for solving issue1 and another workspace bookmark-2 for bookmarks of issue2. The user can create new workspace to store bookmarks and switch between different workspaces. IMO, this would highly improve the user experience of bookmarks.nvim.

Anyway, this is just a small suggestion. Thanks for your effort on bookmarks.nvim.

crusj commented 1 year ago

Sorry for the late response and thanks for your feedback.

Aw, that's why all bookmarks, even those belonging to different projects, will be presented together. I think I opened neovim in the root directory of different projects.

However, the current implementation has several drawbacks, i.e., bookmarks are stored or displayed based on the directory where you are executing nvim.

  • First of all, it's common to open different sub-directories of the same project (let's say subdir1 and subdir2). Under current implementation, one cannot use the bookmarks marked while opening nvim in subdir1 if this time he/she opens nvim in subdir2.
  • Secondly, one may switch between different git branches to solve different issues (let's say the branch1 for issue1 and branch2 for issue2). The bookmarks marked for issue1 will mix with those marked for issue2, which increases the user burden.

I use workspace to express the group/class of bookmarks in logic. For example, there is a workspace bookmark-1 to store all bookmarks marked for solving issue1 and another workspace bookmark-2 for bookmarks of issue2. The user can create new workspace to store bookmarks and switch between different workspaces. IMO, this would highly improve the user experience of bookmarks.nvim.

Anyway, this is just a small suggestion. Thanks for your effort on bookmarks.nvim.

You mean put all the bookmarks together and group them by tags?

PeiweiHu commented 1 year ago

Exactly! The user can create tags and decide the tags of the newly added bookmarks.

crusj commented 1 year ago

Exactly! The user can create tags and decide the tags of the newly added bookmarks.

Adding tabs is fine, but putting all the bookmarks together is not A good idea because I don't want to see the bookmarks of project B when I open p A.

PeiweiHu commented 1 year ago

Agree on not putting them together. But tabs implying current tags will be helpful. Just a personal opinion :-)

image

crusj commented 1 year ago

Agree on not putting them together. But tabs implying current tags will be helpful. Just a personal opinion :-)

image

I'll add this feature sometime.

crusj commented 1 year ago

Agree on not putting them together. But tabs implying current tags will be helpful. Just a personal opinion :-) image

I'll add this feature sometime.

This feature has been added, any questions can be timely feedback. See Tags below README for instructions on how to use tags.

PeiweiHu commented 1 year ago

Happy to see this feature, which is very useful! However, I met the following bugs while using it.

Thanks for your new feature! Hope my feedback is helpful!

crusj commented 1 year ago

Happy to see this feature, which is very useful! However, I met the following bugs while using it.

  • The list of ALL does not show full bookmarks. As shown in the following picture, only one bookmark is shown while there are two bookmarks. p1
  • Fail to remove the tag. As shown in the following picture, currently no bookmark exists under the tag TA. However, TA is not removed automatically. I also failed to remove it although I located my cursor to TA by and pressed dd. p2
  • and raise errors while the window of the plugin is closed. To reproduce it, close the windows of the plugin by `` and press or . IMHO, maybe providing an API to allow the user to set up the shortcuts themselves, or just occupy or when the window of the plugin is opened would be a good choice. ![p3](https://user-images.githubusercontent.com/58985155/267571305-9ab67e76-3c5f-481d-9809-8e6bc01b95f0.PNG)
  • Open the tag last used instead of ALL. Currently when the user opens the window by <tab><tab>, the tag ALL will open automatically. IMO, opening the tag last used (i.e., the tag position at which the window was last closed) will be more practical.

Thanks for your new feature! Hope my feedback is helpful!

Fixed!

PeiweiHu commented 1 year ago

It seems there is still a minor error that leads to the error message when the user presses <c-j>. The PR fixes.

PeiweiHu commented 1 year ago

Now the new feature can work well. Thanks for your efforts.