Do not focus NvimTree upon VimEnter

This commit is contained in:
2023-09-15 22:40:48 +02:00
parent 308080b16f
commit 21b3eeaa4f
+9 -1
View File
@@ -22,7 +22,15 @@ local function term_close()
end
local function open_file_tree()
require("nvim-tree.api").tree.open()
local ok, mod = pcall(require, "nvim-tree.api")
if ok then
-- get current window id
local win = vim.api.nvim_get_current_win()
-- open NvimTree
mod.tree.open()
-- switch back focus to previous window
vim.api.nvim_set_current_win(win)
end
end
vim.api.nvim_create_autocmd("TermClose", {