Neovim/lua/plugins/neotree.lua

85 lines
3.3 KiB
Lua

return {
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim"
},
opts = function(_,_)
local options = require("options")
return {
sources = {
"filesystem",
"buffers",
"git_status",
"document_symbols"
},
source_selector = {
winbar = true,
statusline = false
},
close_if_last_window = true,
popup_border_style = options.ui.border,
default_component_configs = {
container = {
enable_character_fade = true
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = false,
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
modified = {
symbol = "",
},
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "-",-- this can only be used in the git_status source
renamed = "R",-- this can only be used in the git_status source
-- Status type
untracked = "U",
ignored = "",
unstaged = "",
staged = "S",
conflict = "C",
}
}
},
window = {
position = "left",
width = 40
},
filesystem = {
filtered_items = {
visible = true,
hide_dotfiles = false,
hide_gitignored = false,
hide_hidden = false,
},
follow_current_file = {
enabled = true,
leave_dirs_open = true
}
},
buffers = {
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
},
}
end
}
}