feat(neo-tree): Adds copy file name command to Neo-Tree with 'Y' binding (#2137)

Co-authored-by: Ricardo Rebelo <ricardo.rebelo@siemens.com>
This commit is contained in:
pr3c0g 2024-01-21 18:53:57 +00:00 committed by GitHub
parent 71a73e8334
commit 5296d42e6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,10 +57,16 @@ return {
bind_to_cwd = false,
follow_current_file = { enabled = true },
use_libuv_file_watcher = true,
commands = {
copy_file_name = function(state)
local node = state.tree:get_node()
vim.fn.setreg("*", node.name, "c")
end,
},
window = {
mappings = {
["<space>"] = "none",
["Y"] = "copy_file_name",
},
},
default_component_configs = {