File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ It will also open the leafs of the tree leading to the file in the buffer
4545(if you opened a file with something else than the LuaTree, like `fzf` or
4646`:split ` )
4747
48+ | :LuaTreeClipboard | *:LuaTreeClipboard*
49+
50+ Print clipboard content for both cut and copy
51+
4852==============================================================================
4953OPTIONS *nvim-tree-options*
5054
Original file line number Diff line number Diff line change @@ -262,4 +262,22 @@ function M.paste(node)
262262 return do_paste (node , ' copy' , do_copy )
263263end
264264
265+ function M .print_clipboard ()
266+ local content = {}
267+ if # clipboard .move > 0 then
268+ table.insert (content , ' Cut' )
269+ for _ , item in pairs (clipboard .move ) do
270+ table.insert (content , ' * ' .. item .absolute_path )
271+ end
272+ end
273+ if # clipboard .copy > 0 then
274+ table.insert (content , ' Copy' )
275+ for _ , item in pairs (clipboard .copy ) do
276+ table.insert (content , ' * ' .. item .absolute_path )
277+ end
278+ end
279+
280+ return api .nvim_out_write (table.concat (content , ' \n ' ).. ' \n ' )
281+ end
282+
265283return M
Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ function M.refresh()
7979 lib .refresh_tree ()
8080end
8181
82+ function M .print_clipboard ()
83+ fs .print_clipboard ()
84+ end
85+
8286function M .on_enter ()
8387 local bufnr = api .nvim_get_current_buf ()
8488 local bufname = api .nvim_buf_get_name (bufnr )
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ command! LuaTreeOpen lua require'tree'.open()
2222command ! LuaTreeClose lua require' tree' .close ()
2323command ! LuaTreeToggle lua require' tree' .toggle ()
2424command ! LuaTreeRefresh lua require' tree' .refresh ()
25+ command ! LuaTreeClipboard lua require' tree' .print_clipboard ()
2526command ! LuaTreeFindFile lua require' tree' .find_file ()
2627
2728let &cpo = s: save_cpo
You can’t perform that action at this time.
0 commit comments