From c9a24374a896666f969caa6db5d019bf39053a04 Mon Sep 17 00:00:00 2001 From: Mathias Schneider Date: Thu, 28 May 2026 16:02:26 +0200 Subject: [PATCH] yanking filenames in Neotree --- term/.config/nvim/lua/plugins/neo-tree.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/term/.config/nvim/lua/plugins/neo-tree.lua b/term/.config/nvim/lua/plugins/neo-tree.lua index 9927125..db8081b 100644 --- a/term/.config/nvim/lua/plugins/neo-tree.lua +++ b/term/.config/nvim/lua/plugins/neo-tree.lua @@ -8,6 +8,18 @@ return { }, config = function() require("neo-tree").setup({ + window = { + mappings = { + ["Y"] = function(state) + local node = state.tree:get_node() + local abs_path = node:get_id() + local rel_path = vim.fn.fnamemodify(abs_path, ":.") + vim.fn.setreg("+", rel_path) + vim.fn.setreg('"', rel_path) + vim.notify("Copied: " .. rel_path) + end, + }, + }, -- Performance optimizations for large repositories git_status_async = true, git_status_async_options = {