From 5e9274162aa37b2a21aeb76ecaba084b9d78dbe5 Mon Sep 17 00:00:00 2001 From: Super_Z <1401203083@qq.com> Date: Thu, 16 Jul 2026 14:52:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20nvim=20=E6=97=A0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dashboard-nvim 从 opts 改为 config = function() 显式 setup - opts 方式 lazy.nvim 不一定能正确传递给 dashboard 的 setup --- lua/plugins/ui.lua | 50 ++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 3b59984..e8eb187 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -176,32 +176,34 @@ return { -- ───────────────────────────────────────────── { "nvimdev/dashboard-nvim", - lazy = false, -- 🔧 修复:必须立即加载才能在启动时显示 + lazy = false, dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = { - theme = "doom", - config = { - header = { - "", - " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗ ██╗██╗███╗ ███╗", - " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║ ██║██║████╗ ████║", - " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║ ██║██║██╔████╔██║", - " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝╚██╗ ██╔╝██║██║╚██╔╝██║", - " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║", - " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", - "", + config = function() + require("dashboard").setup({ + theme = "doom", + config = { + header = { + "", + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗ ██╗██╗███╗ ███╗", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║ ██║██║████╗ ████║", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║ ██║██║██╔████╔██║", + " ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝╚██╗ ██╔╝██║██║╚██╔╝██║", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", + "", + }, + center = { + { icon = " ", key = "f", desc = "查找文件", action = "Telescope find_files" }, + { icon = " ", key = "r", desc = "最近文件", action = "Telescope oldfiles" }, + { icon = " ", key = "g", desc = "全局搜索", action = "Telescope live_grep" }, + { icon = " ", key = "l", desc = "插件管理", action = "Lazy" }, + { icon = " ", key = "m", desc = "LSP 管理", action = "Mason" }, + { icon = " ", key = "q", desc = "退出", action = "qa" }, + }, + footer = { " atdunbg · Neovim" }, }, - center = { - { icon = " ", key = "f", desc = "查找文件", action = "Telescope find_files" }, - { icon = " ", key = "r", desc = "最近文件", action = "Telescope oldfiles" }, - { icon = " ", key = "g", desc = "全局搜索", action = "Telescope live_grep" }, - { icon = " ", key = "l", desc = "插件管理", action = "Lazy" }, - { icon = " ", key = "m", desc = "LSP 管理", action = "Mason" }, - { icon = " ", key = "q", desc = "退出", action = "qa" }, - }, - footer = { " atdunbg · Neovim" }, - }, - }, + }) + end, }, -- ─────────────────────────────────────────────