nvim-tree.lua icon indicating copy to clipboard operation
nvim-tree.lua copied to clipboard

[Bookmarks] followup features

Open kyazdani42 opened this issue 2 years ago • 7 comments

Since the new marks api has been merged into master, we should now add some integrations with it. This issue is to track related feature requests:

  • [x] bulk move (#1419)
  • [ ] bulk delete
  • [x] navigation (through vim.ui.select) (#1415)
  • [x] navigation (prev / next mark) (#1415)
  • [ ] command runner (in vim)
  • [ ] command runner (system)
  • [ ] marks persistence
  • [ ] bulk open

kyazdani42 avatar Jul 11 '22 08:07 kyazdani42

Awesome PR, one issue I've found so far was icons not aligning with the correct folder when hide_root_folder = true preview

RaafatTurki avatar Jul 11 '22 18:07 RaafatTurki

yep @RaafatTurki i've fixed it in the PR add navigation

kyazdani42 avatar Jul 11 '22 18:07 kyazdani42

I think an another issue that was introduced by this PR is the misalignment of folders and files when indent markers are enabled

renderer.indent_markers.enable = true image

renderer.indent_markers.enable = false image

RaafatTurki avatar Jul 13 '22 13:07 RaafatTurki

unrelated @RaafatTurki, please open a new issue, i believe this is related to https://github.com/kyazdani42/nvim-tree.lua/pull/1408

kyazdani42 avatar Jul 13 '22 14:07 kyazdani42

explain to a beginner: as a result, bookmarks work or not, in the help in paragraph 8 about bookmarks, the default key "m" sets the bookmark icon against the folder, but after restarting the editor, the bookmarks are not saved. And without saving bookmarks when their program exits, they are useless. Or, most likely, did I not understand something? image

tuber84 avatar Jul 23 '22 06:07 tuber84

And without saving bookmarks when their program exits, they are useless.

Bookmarks are not persisted. The documentation does not state that they are persisted. Persistence is possible but not implemented.

Your opinion on their usefulness is noted, however such comments from you are not welcome in the future.

alex-courtis avatar Jul 23 '22 08:07 alex-courtis

What about bulk open?

serhez avatar Jul 25 '22 15:07 serhez

Bulk move and bulk open are actions designed for temporary marks (not bookmarks), while navigating marks and marks persistence are more designed for permanent marks (like bookmarks).

I think it would make sense to have two types of marks. Bookmarks (blue) and temporary marks (red). Bookmarks could be toggled with capital M instead of m. Bookmarks then should be persisted in the .local directory somewhere.

What do you think?

Also, could we add a bullet point for a proper documentation of all the features?

Finally, I'd like to say I love the direction this plugin is heading towards to.

martin-braun avatar Oct 08 '22 12:10 martin-braun

See #1795

alex-courtis avatar Dec 03 '22 03:12 alex-courtis

@alex-courtis until someone tackles a bulk delete PR, do you happen to have some snippet to achieve such functionality (using current API methods)?

petobens avatar Dec 16 '22 02:12 petobens

This should get you started:

			mappings = {
				custom_only = false,
				list = {
					{
						key = "bd",
						action = "bulk_delete",
						action_cb = function()
							local nodes = require("nvim-tree.api").marks.list()

							for _, node in ipairs(nodes) do
								print("deleting " .. (node.absolute_path or "???"))

								-- safely delete the file  :help api.txt
							end
						end,
					},
				},
			},

It would be fantastic if you could post your solution on the wiki

Even better would be a PR to add this functionality to nvim-tree

alex-courtis avatar Dec 16 '22 03:12 alex-courtis

Let's continue discussion in the existing issue: #1804

alex-courtis avatar Dec 16 '22 03:12 alex-courtis

API functionality is sufficient.

Potential tasks such as delete are tracked elsewhere.

alex-courtis avatar Apr 11 '23 04:04 alex-courtis

Would a bulk file copy be on the table as well?

gabevenberg avatar Jun 29 '23 16:06 gabevenberg

Would a bulk file copy be on the table as well?

Of course! The implementation would be very similar to bulk-move.lua.

Pull Requests are most gratefully appreciated.

Bulk Delete bd was recently added: #2276

alex-courtis avatar Jul 01 '23 02:07 alex-courtis