Skip to content

feat(bookmarks): add bookmark feature #1412

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

Merged
merged 1 commit into from
Jul 11, 2022
Merged

feat(bookmarks): add bookmark feature #1412

merged 1 commit into from
Jul 11, 2022

Conversation

kyazdani42
Copy link
Member

@kyazdani42 kyazdani42 commented Jul 10, 2022

Uses the signcolum to display the mark status.
Marks are saved in memory for now, we'll see if we want to implement a
filesystem save for the marks (would not be hard).
Added m keybinding to toggle the mark on the node
Users can call require "nvim-tree.marks".get_marks() which returns a
list of absolute paths.

superseeds #612

TODO:

  • small bulk rename action (in followup PR)

Fixes #221
Fixes #51
Fixes #595
Fixes #509

@kyazdani42 kyazdani42 requested a review from alex-courtis July 10, 2022 09:40
@kyazdani42 kyazdani42 changed the title feat(bookmarks): add bookmark feature for nodes feat(bookmarks): add bookmark feature Jul 10, 2022
Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users will complain when they see that marks do not yet do anything. Here's a branch that hides marks behind a "feature flag" feat/bookmarks...feat/bookmarks-amc

At some point can do more with the marks API e.g.
set_marks(table)
toggle_mark(string)
add_mark(string)
remove_mark(string)

In the far future we could define an official API e.g.
require "nvim-tree-api".toggle()
require "nvim-tree-api".get_marks()

@kyazdani42
Copy link
Member Author

@alex-courtis i don't think hiding this behind a feature flag is useful, i think first leaving a simple api for the users so people can start building integration with the marks would be better. Even if people complain, they can just script something and open a PR if they feel the feature they write would be useful in nvim-tree.
I think we could add a note in the contributing.md for the marks, such as how to develop a feature for it. I think i also could add a bulk action method for removal, moving or such.

@alex-courtis
Copy link
Member

@alex-courtis i don't think hiding this behind a feature flag is useful, i think first leaving a simple api for the users so people can start building integration with the marks would be better. Even if people complain, they can just script something and open a PR if they feel the feature they write would be useful in nvim-tree. I think we could add a note in the contributing.md for the marks, such as how to develop a feature for it. I think i also could add a bulk action method for removal, moving or such.

Sounds good. Feature flagging functionality is not nice and creates future work.

Having a useful API should be enough to keep people happy.

@kyazdani42 kyazdani42 force-pushed the feat/bookmarks branch 2 times, most recently from 254753a to 874b18e Compare July 11, 2022 07:49
Copy link
Member

@alex-courtis alex-courtis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NvimTreeBookmark in :help

@kyazdani42 kyazdani42 force-pushed the feat/bookmarks branch 2 times, most recently from 1eefa6e to 5b652dc Compare July 11, 2022 07:56
@kyazdani42
Copy link
Member Author

I've added the docs, lets merge this and add the features in followup PRs

Uses the signcolum to display the mark status.
Marks are saved in memory for now, we'll see if we want to implement a
filesystem save for the marks (would not be hard).
Added `m` keybinding to toggle the mark on the node.
Users can call `require "nvim-tree.marks".get_marks()` which returns a
list of absolute paths.
@kyazdani42 kyazdani42 merged commit df92f15 into master Jul 11, 2022
@kyazdani42 kyazdani42 deleted the feat/bookmarks branch July 11, 2022 08:00
@alex-courtis
Copy link
Member

I've added the docs, lets merge this and add the features in followup PRs

Yes. Long running branches are undesirable.

I'll get to the follow up PRs on the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

marks capability like netrw Bookmark a folder Marks for multiple remove/move Few feature requests
2 participants