Neovim/lua/plugins/neo-tree.lua

100 lines
3.3 KiB
Lua

--
-- Pretty file tree with various sources
--
-- Source: https://github.com/nvim-neo-tree/neo-tree.nvim
-- ..............................................
--
-- Author: Sven Vogel
-- Created: 01.11.2024
-- Edited: 07.11.2024
--
-- ==============================================
ui = require 'config.ui'
return {
"nvim-neo-tree/neo-tree.nvim",
lazy = false,
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
--
-- List language server diagnostics
--
-- Source: https://github.com/mrbjarksen/neo-tree-diagnostics.nvim
-- ..............................................
--
'mrbjarksen/neo-tree-diagnostics.nvim'
},
cmd = "Neotree",
opts = {
popup_border_style = ui.border,
sources = {
"filesystem",
"document_symbols",
"git_status",
"diagnostics"
},
source_selector = {
winbar = true,
statusline = false,
sources = {
{
source = "filesystem",
display_name = " 󰉓 Files "
},
{
source = "document_symbols",
display_name = "  Symbols "
},
{
source = "diagnostics",
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 = {
bind_to_cwd = false,
follow_current_file = { enabled = true },
use_libuv_file_watcher = true,
hijack_netrw_behavior = "open_default",
filtered_items = {
hide_dotfiles = false,
hide_gitignored = false,
hide_hidden = false, -- only works on Windows for hidden files/directories
},
window = {
position = "left"
}
},
close_if_last_window = false,
default_component_configs = {
container = {
enable_character_fade = true
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
with_markers = true,
indent_marker = "",
last_indent_marker = "",
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
}
}
}
}