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
45
45
(if you opened a file with something else than the LuaTree, like `fzf` or
46
46
`:split ` )
47
47
48
+ | :LuaTreeClipboard | *:LuaTreeClipboard*
49
+
50
+ Print clipboard content for both cut and copy
51
+
48
52
==============================================================================
49
53
OPTIONS *nvim-tree-options*
50
54
Original file line number Diff line number Diff line change @@ -262,4 +262,22 @@ function M.paste(node)
262
262
return do_paste (node , ' copy' , do_copy )
263
263
end
264
264
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
+
265
283
return M
Original file line number Diff line number Diff line change @@ -79,6 +79,10 @@ function M.refresh()
79
79
lib .refresh_tree ()
80
80
end
81
81
82
+ function M .print_clipboard ()
83
+ fs .print_clipboard ()
84
+ end
85
+
82
86
function M .on_enter ()
83
87
local bufnr = api .nvim_get_current_buf ()
84
88
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()
22
22
command ! LuaTreeClose lua require' tree' .close ()
23
23
command ! LuaTreeToggle lua require' tree' .toggle ()
24
24
command ! LuaTreeRefresh lua require' tree' .refresh ()
25
+ command ! LuaTreeClipboard lua require' tree' .print_clipboard ()
25
26
command ! LuaTreeFindFile lua require' tree' .find_file ()
26
27
27
28
let &cpo = s: save_cpo
You can’t perform that action at this time.
0 commit comments