fix: UI 插件不显示问题

- bufferline/lualine/dashboard/nvim-notify 改为 lazy=false 立即加载
- 添加 bufdelete.nvim 依赖(bufferline close_command 需要 Bdelete)
- lazy.lua 补回 defaults.lazy = true
- 修复 nvim . 打开目录时看不到标签栏和状态栏的问题
This commit is contained in:
2026-07-16 13:21:51 +08:00
parent 8ad2067a64
commit 29169fe2e8
2 changed files with 19 additions and 4 deletions
+6
View File
@@ -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" },
+13 -4
View File
@@ -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",