-
How do I mark multiple files so that I can delete, cut, and move them all at once? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
+1 I would also like to know how to do this. |
Beta Was this translation helpful? Give feedback.
-
I take the reference of #1804: local bulk_trash = function()
local nodes = api.marks.list()
if next(nodes) == nil then
table.insert(nodes, api.get_node_under_cursor())
end
vim.ui.input({ prompt = string.format("Trash %s files? [y/n] ", #nodes) }, function(input)
if input == "y" then
for _, node in ipairs(nodes) do
vim.fn.jobstart("trash-put " .. node.absolute_path)
end
api.tree.reload()
end
end)
end
vim.keymap.set("n", "bmr", bulk_trash, opts("Bulk Trash Files"))
it works for me:) |
Beta Was this translation helpful? Give feedback.
-
That's really nice! Could you please add that to the wiki: Recipes |
Beta Was this translation helpful? Give feedback.
-
You could call |
Beta Was this translation helpful? Give feedback.
Hey! guys,
I am glad to show you how I write my
on_attach
file to realize this marked file operations!please see the wiki:
https://github.com/nvim-tree/nvim-tree.lua/wiki/Recipes#modify-you-on_attach-function-to-have-ability-to-operate-multiple-files-at-once