2024-05-07 12:47:00 +00:00
|
|
|
return {
|
|
|
|
"nvim-neo-tree/neo-tree.nvim",
|
|
|
|
dependencies = {
|
|
|
|
{ "nvim-lua/plenary.nvim", lazy = true },
|
|
|
|
{ "nvim-tree/nvim-web-devicons", lazy = true },
|
|
|
|
{ "MunifTanjim/nui.nvim", lazy = true },
|
|
|
|
},
|
|
|
|
cmd = "Neotree",
|
|
|
|
opts = function()
|
|
|
|
local git_available = vim.fn.executable("git") == 1
|
|
|
|
local get_icon = require("nvim-web-devicons").get_icon
|
|
|
|
local opts = {
|
2024-08-24 11:17:41 +00:00
|
|
|
filesystem = {
|
|
|
|
filtered_items = {
|
|
|
|
visible = true,
|
|
|
|
},
|
|
|
|
},
|
2024-05-07 12:47:00 +00:00
|
|
|
enable_git_status = git_available,
|
|
|
|
auto_clean_after_session_restore = true,
|
|
|
|
close_if_last_window = true,
|
|
|
|
sources = { "filesystem", "buffers", "git_status" },
|
|
|
|
source_selector = {
|
|
|
|
winbar = true,
|
|
|
|
content_layout = "center",
|
|
|
|
sources = {
|
|
|
|
{ source = "filesystem", display_name = " Files " },
|
|
|
|
{ source = "buffers", display_name = " Bufs " },
|
|
|
|
{ source = "git_status", display_name = " Git " },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
window = {
|
|
|
|
width = 30,
|
|
|
|
mappings = {
|
|
|
|
["[b"] = "prev_source",
|
|
|
|
["]b"] = "next_source",
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
return opts
|
|
|
|
end,
|
|
|
|
keys = {
|
|
|
|
{ "<leader>e", "<cmd>Neotree toggle<cr>", desc = "Toggle explorer"},
|
|
|
|
{
|
|
|
|
"<leader>o",
|
|
|
|
function()
|
|
|
|
if vim.bo.filetype == "neo-tree" then
|
|
|
|
vim.cmd.wincmd("p")
|
|
|
|
else
|
|
|
|
vim.cmd.Neotree("focus")
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
desc = "Toggle explorer"},
|
|
|
|
},
|
|
|
|
}
|