From 29169fe2e8a84da8fe225a840d1ce496b10e8fbf Mon Sep 17 00:00:00 2001 From: Super_Z <1401203083@qq.com> Date: Thu, 16 Jul 2026 13:21:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20UI=20=E6=8F=92=E4=BB=B6=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bufferline/lualine/dashboard/nvim-notify 改为 lazy=false 立即加载 - 添加 bufdelete.nvim 依赖(bufferline close_command 需要 Bdelete) - lazy.lua 补回 defaults.lazy = true - 修复 nvim . 打开目录时看不到标签栏和状态栏的问题 --- lua/config/lazy.lua | 6 ++++++ lua/plugins/ui.lua | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 02ce6fe..081fc74 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -5,6 +5,7 @@ -- 【修改】🔧 install.colorscheme 改为 tokyonight(你的主题); -- 🔧 添加 ui.border = "rounded" 统一圆角; -- 🔧 添加 performance.rtp 禁用内置插件提升启动速度。 +-- 【修复】🔧 defaults.lazy = true(保留你的原设置),但 UI 核心插件不懒加载。 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.uv.fs_stat(lazypath) then @@ -21,6 +22,11 @@ require("lazy").setup({ { import = "plugins" }, }, + -- 🔧 修复:保留你的 defaults.lazy = true + defaults = { + lazy = true, + }, + -- 🔧 修改:安装时尝试加载你的主题 install = { colorscheme = { "tokyonight", "habamax" }, diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 39448e6..3b333a6 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -4,6 +4,8 @@ -- 【全新文件】这是从参考配置提取 + 定制的 UI 套件。 -- 包含:bufferline(标签栏)、lualine(状态栏)、noice(命令行)、 -- nvim-notify(通知)、dashboard(启动页)、dressing(输入框)。 +-- 【修复】🔧 bufferline/lualine/dashboard 改为 lazy=false 立即加载, +-- 避免 nvim . 打开目录时 UI 不显示。 return { @@ -13,8 +15,13 @@ return { { "akinsho/bufferline.nvim", version = "*", - event = "BufReadPre", - dependencies = "nvim-tree/nvim-web-devicons", + -- 🔧 修复:去掉 event = "BufReadPre",改为立即加载 + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + -- ✅ 新增:提供 Bdelete 命令,让 close_command 能正常工作 + "famiu/bufdelete.nvim", + }, config = function() require("bufferline").setup({ options = { @@ -69,7 +76,8 @@ return { -- ───────────────────────────────────────────── { "nvim-lualine/lualine.nvim", - event = "VimEnter", + -- 🔧 修复:改为立即加载,确保一打开就有状态栏 + lazy = false, dependencies = { "nvim-tree/nvim-web-devicons", }, @@ -134,6 +142,7 @@ return { -- ───────────────────────────────────────────── { "rcarriga/nvim-notify", + lazy = false, -- 🔧 修复:立即加载,让 noice 能用 opts = { timeout = 3000, max_width = 50, @@ -161,7 +170,7 @@ return { -- ───────────────────────────────────────────── { "nvimdev/dashboard-nvim", - event = "VimEnter", + lazy = false, -- 🔧 修复:必须立即加载才能在启动时显示 dependencies = { "nvim-tree/nvim-web-devicons" }, opts = { theme = "doom",