nvim-tree.lua
nvim-tree.lua copied to clipboard
[Bookmarks] followup features
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
Awesome PR, one issue I've found so far was icons not aligning with the correct folder when hide_root_folder = true
preview
yep @RaafatTurki i've fixed it in the PR add navigation
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
renderer.indent_markers.enable = false
unrelated @RaafatTurki, please open a new issue, i believe this is related to https://github.com/kyazdani42/nvim-tree.lua/pull/1408
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?
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.
What about bulk open?
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.
See #1795
@alex-courtis until someone tackles a bulk delete PR, do you happen to have some snippet to achieve such functionality (using current API methods)?
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
Let's continue discussion in the existing issue: #1804
API functionality is sufficient.
Potential tasks such as delete are tracked elsewhere.
Would a bulk file copy be on the table as well?
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