neovim: Open tree by default

This commit is contained in:
Donovan Glover 2023-06-06 07:27:04 -04:00
parent c588b3a0d8
commit f0867c039e
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -69,6 +69,19 @@
end end
end end
}) })
local function open_nvim_tree(data)
local real_file = vim.fn.filereadable(data.file) == 1
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
if not real_file and not no_name then
return
end
require("nvim-tree.api").tree.toggle({ focus = false, find_file = true })
end
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
''; '';
} }
{ {