feat(nvim): update neo-tree to v3 and add nesting rules

This commit is contained in:
Bruno Carlin 2024-04-20 17:16:04 +02:00
parent b7ba229cf8
commit 00f6d6b3b1
Signed by: bcarlin
GPG key ID: 8E254EA0FFEB9B6D
2 changed files with 176 additions and 159 deletions

View file

@ -19,7 +19,7 @@ return require('packer').startup(function(use)
}
use {
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
branch = "v3.x",
requires = {
"nvim-lua/plenary.nvim",
"kyazdani42/nvim-web-devicons", -- not strictly required, but recommended

View file

@ -35,7 +35,7 @@ local config = {
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "",
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 = "*",
@ -56,11 +56,11 @@ local config = {
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 = "",-- this can only be used in the git_status source
renamed = "󰁕",-- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "",
unstaged = "󰄱",
staged = "",
conflict = "",
}
@ -107,7 +107,24 @@ local config = {
["?"] = "show_help",
}
},
nesting_rules = {},
nesting_rules = {
["js"] = {
pattern = "(.+)%.js$",
files = { "%1.js.map", "%1.min.js", "%1.d.ts" },
},
["css"] = {
pattern = "(.+)%.css$",
files = { "%1.css.map", "%1.min.css" },
},
["go"] = {
pattern = "(.*)%.go$",
files = { "%1_test.go" },
},
["templ"] = {
pattern = "(.*)%.templ$",
files = { "%1_templ.go" },
},
},
filesystem = {
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
@ -125,7 +142,7 @@ local config = {
--"thumbs.db"
},
},
follow_current_file = false, -- This will find and focus the file in the active buffer every
follow_current_file = { enabled = false }, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = false, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
@ -149,7 +166,7 @@ local config = {
}
},
buffers = {
follow_current_file = true, -- This will find and focus the file in the active buffer every
follow_current_file = { enabled = false }, -- This will find and focus the file in the active buffer every
-- time the current file is changed while the tree is open.
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,