feat: add diagnostic and document symbols source to neo-tree

This commit is contained in:
Sven Vogel 2024-11-10 22:34:23 +01:00
parent 8e01e20202
commit 5ea47d03d3
1 changed files with 28 additions and 6 deletions

View File

@ -19,11 +19,24 @@ return {
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim" "MunifTanjim/nui.nvim",
--
-- List language server diagnostics
--
-- Source: https://github.com/mrbjarksen/neo-tree-diagnostics.nvim
-- ..............................................
--
'mrbjarksen/neo-tree-diagnostics.nvim'
}, },
cmd = "Neotree", cmd = "Neotree",
opts = { opts = {
popup_border_style = ui.border, popup_border_style = ui.border,
sources = {
"filesystem",
"document_symbols",
"git_status",
"diagnostics"
},
source_selector = { source_selector = {
winbar = true, winbar = true,
statusline = false, statusline = false,
@ -33,15 +46,24 @@ return {
display_name = " 󰉓 Files " display_name = " 󰉓 Files "
}, },
{ {
source = "buffers", source = "document_symbols",
display_name = " 󰈚 Buffers " display_name = "  Symbols "
}, },
{ {
source = "document_symbols", source = "diagnostics",
display_name = " 󰊢 Git " display_name = "  Diagnostics "
}, }
}, },
}, },
diagnostics = {
follow_current_file = { -- May also be set to `true` or `false`
enabled = true, -- This will find and focus the file in the active buffer every time
always_focus_file = false, -- Focus the followed file, even when focus is currently on a diagnostic item belonging to that file
expand_followed = true, -- Ensure the node of the followed file is expanded
leave_dirs_open = true, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
leave_files_open = true, -- `false` closes auto expanded files, such as with `:Neotree reveal`
}
},
filesystem = { filesystem = {
bind_to_cwd = false, bind_to_cwd = false,
follow_current_file = { enabled = true }, follow_current_file = { enabled = true },