refactor nvim: neo-tree調整結構成lazy的格式
This commit is contained in:
parent
ccdbc64be5
commit
6456ddb4f9
@ -79,29 +79,7 @@ return {
|
|||||||
-----Instead of using `config`, you can use `opts` instead, if you'd like:
|
-----Instead of using `config`, you can use `opts` instead, if you'd like:
|
||||||
-----@module "neo-tree"
|
-----@module "neo-tree"
|
||||||
-----@type neotree.Config
|
-----@type neotree.Config
|
||||||
--opts = {},
|
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({
|
|
||||||
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
|
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+
|
popup_border_style = "NC", -- or "" to use 'winborder' on Neovim v0.11+
|
||||||
enable_git_status = true,
|
enable_git_status = true,
|
||||||
@ -422,7 +400,29 @@ return {
|
|||||||
winbar = false,
|
winbar = false,
|
||||||
statusline = 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>")
|
-- vim.keymap.set("n", "<leader>e", "<Cmd>Neotree reveal<CR>")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user