From 8f57e997d0337e2437ad936b8174cb8ad7324528 Mon Sep 17 00:00:00 2001 From: Ricardo Rebelo Date: Tue, 5 Dec 2023 11:58:09 +0000 Subject: [PATCH] Adds copy file name command to Neo-Tree with 'Y' binding --- lua/lazyvim/plugins/editor.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index b5f529e5..fe5ae4c2 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -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 = { [""] = "none", + ["Y"] = "copy_file_name", }, }, default_component_configs = {