From 11727650eae85ed818c6de46fa8b82aab698643c Mon Sep 17 00:00:00 2001 From: mightywilly <> Date: Sun, 7 Apr 2024 14:39:51 +0200 Subject: [PATCH] Fixed: Neotree isn't properly invoked when a directory is given at launch When a directory is given at lunch through argument e.g. "nvim .", LazyVim opens Neo-tree side window instead of the dashboard. However, the instance isn't fully initialized: if one opens a file directly from Neotree, the tree buffer will be override by that file. And toggling Neotree will then result in error "failed to rename the buffer". Manually toggling Neotree can solve this issue. --- lua/lazyvim/plugins/editor.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/editor.lua b/lua/lazyvim/plugins/editor.lua index 37bcc9cb..eb950265 100644 --- a/lua/lazyvim/plugins/editor.lua +++ b/lua/lazyvim/plugins/editor.lua @@ -45,6 +45,7 @@ return { local stat = vim.uv.fs_stat(vim.fn.argv(0)) if stat and stat.type == "directory" then require("neo-tree") + vim.cmd("Neotree toggle") end end end,