2023-12-14 13:20:36 +00:00
|
|
|
return{
|
|
|
|
{
|
|
|
|
"nvim-tree/nvim-tree.lua",
|
|
|
|
enabled = custom.full_feature,
|
|
|
|
dependencies = {
|
|
|
|
"nvim-tree/nvim-web-devicons"
|
|
|
|
},
|
|
|
|
main = "nvim-tree",
|
|
|
|
event = "VeryLazy",
|
|
|
|
opts = {
|
|
|
|
filters = {
|
|
|
|
git_ignored = false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
keys = {
|
2023-12-14 13:45:10 +00:00
|
|
|
{ "<leader>t", "<cmd>NvimTreeFocus<cr>", mode = "n" },
|
|
|
|
{ "<leader>f", "<cmd>NvimTreeFindFile<cr>", mode = "n" },
|
2023-12-14 13:20:36 +00:00
|
|
|
},
|
|
|
|
init = function(_)
|
|
|
|
vim.g.loaded_netrw = 1
|
|
|
|
vim.g.loaded_netrwPlugin = 1
|
|
|
|
|
|
|
|
vim.api.nvim_create_autocmd("QuitPre", {
|
|
|
|
callback = function()
|
|
|
|
local invalid_win = {}
|
|
|
|
local wins = vim.api.nvim_list_wins()
|
|
|
|
for _, w in ipairs(wins) do
|
|
|
|
local bufname = vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w))
|
|
|
|
if bufname:match("NvimTree_") ~= nil then
|
|
|
|
table.insert(invalid_win, w)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
if #invalid_win == #wins - 1 then
|
|
|
|
-- Should quit, so we close all invalid windows.
|
|
|
|
for _, w in ipairs(invalid_win) do vim.api.nvim_win_close(w, true) end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
},
|
|
|
|
}
|