Do not focus NvimTree upon VimEnter
This commit is contained in:
@@ -22,7 +22,15 @@ local function term_close()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function open_file_tree()
|
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
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("TermClose", {
|
vim.api.nvim_create_autocmd("TermClose", {
|
||||||
|
|||||||
Reference in New Issue
Block a user