From 4478c5d5921d9bce169e1f710492f5872fb90f42 Mon Sep 17 00:00:00 2001 From: Nikita Bykov Date: Mon, 2 Jun 2025 23:02:12 +0500 Subject: [PATCH] add auto neotree close on file open --- .config/nvim/lua/user/neotree.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/user/neotree.lua b/.config/nvim/lua/user/neotree.lua index 0771971..29f7711 100644 --- a/.config/nvim/lua/user/neotree.lua +++ b/.config/nvim/lua/user/neotree.lua @@ -71,6 +71,12 @@ require("neo-tree").setup({ handler = function(arg) vim.opt.relativenumber = true end, - } + }, + { + event = "file_open_requested", + handler = function() + require("neo-tree.command").execute({ action = "close" }) + end + }, }, })