kickstart.nvim/lua/custom/plugins/neotree.lua

56 lines
1.9 KiB
Lua

return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
init = function()
-- Neotree:
vim.keymap.set('n', '<leader>nt', '<Cmd>Neotree toggle<CR>', { desc = '[N]eo[t]ree toggle' })
vim.keymap.set('n', '<leader>ntr', '<Cmd>Neotree reveal<CR>', { desc = 'N[E]eo[t]ree toggle cu[r]rent' })
end,
config = function()
require('neo-tree').setup {
default_component_configs = {
indent = {
indent_size = 1,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = '',
last_indent_marker = '',
highlight = 'NeoTreeIndentMarker',
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = '',
expander_expanded = '',
expander_highlight = 'NeoTreeExpander',
},
icon = {
folder_closed = '',
folder_open = '',
folder_empty = '󰜌',
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = '*',
highlight = 'NeoTreeFileIcon',
},
},
window = {
position = 'left',
width = 30,
},
filesystem = {
hide_dotfiles = false,
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
},
}
end,
}