From 692408380d780fd2f408ba27751138cc3daada95 Mon Sep 17 00:00:00 2001 From: Nydragon Date: Sun, 16 Jun 2024 18:06:55 +0900 Subject: [PATCH] fix(nvim-tree): update autocmd used to open nvim-tree --- lua/nvim-tree-config.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/nvim-tree-config.lua b/lua/nvim-tree-config.lua index 40086ab..92dab5e 100644 --- a/lua/nvim-tree-config.lua +++ b/lua/nvim-tree-config.lua @@ -32,7 +32,8 @@ local function open_nvim_tree(data) }) end -vim.api.nvim_create_autocmd({ "BufEnter" }, { callback = open_nvim_tree }) +-- Using VimEnter is crucial, other autocmds will break the "focus = false" behaviour +vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) -- From https://github.com/nvim-tree/nvim-tree.lua/issues/1368#issuecomment-1512248492 vim.api.nvim_create_autocmd("QuitPre", {