refactor nvim: neo-tree調整結構成lazy的格式

This commit is contained in:
Yuan Chiu 2025-05-01 18:40:06 +08:00
parent ccdbc64be5
commit 6456ddb4f9

View File

@ -79,29 +79,7 @@ return {
-----Instead of using `config`, you can use `opts` instead, if you'd like:
-----@module "neo-tree"
-----@type neotree.Config
--opts = {},
config = function()
-- If you want icons for diagnostic errors, you'll need to define them somewhere.
-- In Neovim v0.10+, you can configure them in vim.diagnostic.config(), like:
--
-- vim.diagnostic.config({
-- signs = {
-- text = {
-- [vim.diagnostic.severity.ERROR] = '',
-- [vim.diagnostic.severity.WARN] = '',
-- [vim.diagnostic.severity.INFO] = '',
-- [vim.diagnostic.severity.HINT] = '󰌵',
-- },
-- }
-- })
--
-- In older versions, you can define the signs manually:
-- vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" })
-- vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" })
-- vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" })
-- vim.fn.sign_define("DiagnosticSignHint", { text = "󰌵", texthl = "DiagnosticSignHint" })
require("neo-tree").setup({
opts = {
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = "NC", -- or "" to use 'winborder' on Neovim v0.11+
enable_git_status = true,
@ -422,7 +400,29 @@ return {
winbar = false,
statusline = false
}
})
},
config = function(_, opts)
-- If you want icons for diagnostic errors, you'll need to define them somewhere.
-- In Neovim v0.10+, you can configure them in vim.diagnostic.config(), like:
--
-- vim.diagnostic.config({
-- signs = {
-- text = {
-- [vim.diagnostic.severity.ERROR] = '',
-- [vim.diagnostic.severity.WARN] = '',
-- [vim.diagnostic.severity.INFO] = '',
-- [vim.diagnostic.severity.HINT] = '󰌵',
-- },
-- }
-- })
--
-- In older versions, you can define the signs manually:
-- vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" })
-- vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" })
-- vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" })
-- vim.fn.sign_define("DiagnosticSignHint", { text = "󰌵", texthl = "DiagnosticSignHint" })
require("neo-tree").setup(opts)
-- vim.keymap.set("n", "<leader>e", "<Cmd>Neotree reveal<CR>")