From 09f4829dbdf3a545cd71d97cad96c74dc6496970 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Mon, 14 Apr 2025 00:38:17 +0200 Subject: [PATCH] fix(neo-tree): change focus to initial window on startup --- lua/plugins/neo-tree.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index ffc333a..883f9b6 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -99,5 +99,11 @@ return { hijack_netrw_behavior = "disabled", }, }, - init = toggle_neo_tree, + init = function() + vim.defer_fn(function() + local winnr = vim.api.nvim_get_current_win() + toggle_neo_tree() + vim.api.nvim_set_current_win(winnr) + end, 100) + end, }