From eccf3b5e68035516c879b3e2b4d6bf8512c87976 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 21 Jan 2024 21:32:09 +0100 Subject: [PATCH] fix(neo-tree): better copy file name with `Y` --- lua/lazyvim/plugins/editor.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index f96fff9a..f9f162ad 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -57,17 +57,15 @@ 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", + ["Y"] = function(state) + local node = state.tree:get_node() + local path = node:get_id() + vim.fn.setreg("+", path, "c") + end, }, }, default_component_configs = {